
On 2009 Mar 18, at 16:59, Colin Paul Adams wrote:
"Brandon" == Brandon S Allbery KF8NH
writes: The array has 12 elements.
Brandon> How many times do you call it? Perhaps the real Brandon> optimization you need is to memoize.
Very many times indeed. But it is a different array on most occasions (I am not updating in place).
It represents one rank of the board on which the game is played. The move generator produces a new board for each move.
It might be helpful for you to show more of the program. One thing to keep in mind about parallelization is that the level at which happens matters: if individual calculations across the list are fast, all you gain by parallelizing it is MP synchronization/locking overhead. On the other hand, it's possible that if the caller can be rearranged so that rank_value is computed on another CPU while it's doing something else, you could gain quite a bit. Or maybe the caller is itself at the right level to parallelize. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH