Optimizations

Parallel Evaluation

On linux and macos, it is possible to perform evaluation in parallel, using multiple cores.

To enable such behaviour, you should replace the default SequentialEvaluator with ParallelEvaluator

class geneticengine.evaluation.parallel.ParallelEvaluator

Evaluates individuals in parallel, each time they are needed.

Sub-tree caching

A good way of implementing sub-tree caching is to use a fitness function (separate from methods) that uses @lru_cache. Notice that your dataclasses need the unsafe_hash parameter.