Closed recursion-ninja closed 6 years ago
There is a first draft approach here: https://github.com/amnh/PCG/tree/CompactExperiment
This currently returns: pcg: compaction failed: cannot compact functions
This is because some of the decoration fields have functions like:
symbolChangeMatrixData :: Word -> Word -> Word transitionCostMatrixData :: c -> c -> (c, Word)
It may still be possible to use compact regions by re-writing how the metric data of these types are stored in the decoration.
@Boarders I believe that is has been implemented. Should we close the issue?
GHC 8.2.1 introduces the primitive memory management helper library known as "compact regions".
If we define our search state as a compact region, we will get the benefit of:
Almost certainly better garbage collector performance.
An easy language defined way to serialize and reload our search states to and from disk.