Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow heapset to manage closed state #17

Merged
merged 1 commit into from
Dec 23, 2012

Conversation

jgulotta
Copy link
Contributor

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

Partially address LearnProgramming#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
jgulotta added a commit that referenced this pull request Dec 23, 2012
Allow heapset to manage closed state
@jgulotta jgulotta merged commit 60a9eda into LearnProgramming:master Dec 23, 2012
@jgulotta jgulotta deleted the no-closed-set branch December 23, 2012 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant