Move prior calculation into a separate thread
ujh opened this issue · comments
The updating of the tree and there especially the prior calculation seems to be a big bottleneck. Maybe moving the calculation of the priors into a separate thread (or several) could help. Obviously it's not clear if that will even increase the number of playouts as this other thread will steal resources from the threads that are doing the playouts. Also selecting nodes while the priors aren't set yet may have unintended consequences as well.
As for the concrete idea:
- Pick a leaf to expand and just set the neutral prior
- Push the playout to one of the worker threads (same as before)
- Push calculation of the priors to another worker (new code)
- Update the tree with the result from the playout (same as before)
- Update the tree with the result from the prior calculation (new code)
Done with #275.