Skip to content

Commit

Permalink
prefect: Optimize Comment for Clarity on Performance Concerns
Browse files Browse the repository at this point in the history
This commit updates the comment preceding the deinitializeIfNeeded() call
in the getBestMove function. The revised comment more clearly articulates
the performance implications of frequent initialization and deinitialization
in a performance-sensitive environment. It emphasizes the need for a
more efficient approach to managing initialization cycles, thereby guiding
future optimizations and code maintenance efforts.

Reference: ggevay/malom#3 (comment)
Change-Id: I0f8ed192d5a40f2485d7e7819c42e553c265909f
  • Loading branch information
calcitem committed Dec 25, 2023
1 parent c24e536 commit ececde1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/perfect/perfect_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ int MalomSolutionAccess::getBestMove(int whiteBitboard, int blackBitboard,
"from the starting position.");
}

// TODO: Considering the performance-critical aspect of our applications,
// it is advised to reconsider the frequent invocation of
// deinitializeIfNeeded() within each getBestMove call. Such a practice
// necessitates the re-initialization by initializeIfNeeded() at every
// function start, leading to significant performance overheads. An
// optimized approach for initialization and deinitialization processes
// should be explored to mitigate these costs.
// https://github.com/ggevay/malom/pull/3#discussion_r1349745071
deinitializeIfNeeded();

return ret;
Expand Down

0 comments on commit ececde1

Please sign in to comment.