Originally created by: enz
Originally owned by: somebody
There are two things that could be optimized in the current implementation of the playout patterns (GoUctPatterns):
It is unnecessary that each thread state contains its own instance because after construction, only const functions are used. It would speed up the startup time of Fuego with multiple threads and save CPU cache if GoUctGlobalSearch owned a single instance of the patterns that is used by all threads.
It is possible to speed up the pattern lookup by not treating edge patterns separately. This would get rid of another if statement that can stall the CPU pipeline. It would increase the size of the lookup table because then four point states would be possible (black, white, empty, border), but many combinations do not occur in practice, so large parts of the table would not pollute the CPU cache. Should the increased size be a problem, a bitset could be used instead of a bool array.
Original comment by: enz
Implementation hint: It is probably best to add the patterns as a member to GoUctPlayoutPolicyParam and rename it to GoUctPlayoutPolicySharedConst, because it then contains all constant objects that are shared between the playouts, not only parameters.