Allow heapset to manage closed state #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially address #8
HeapSet now remembers all states whether they are on the heap or not and has accordingly been renamed to CachingHeapSet.
States will only be put on the heap, updated, or reinserted if they a) were not there before or b) are not closed and of higher priority than what's already on the heap.
States are optionally closed when they are popped off the heap.
Memory use and allocations went down from eliminating the extra set.
3x3 case
Before: total heap usage: 27,547 allocs, 27,547 frees, 2,123,227 bytes
allocated
After: total heap usage: 26,681 allocs, 26,681 frees, 2,087,203 bytes
allocated