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

Use HeapSet, a combination set and priority queue #13

Merged
merged 1 commit into from
Dec 20, 2012

Conversation

jgulotta
Copy link
Contributor

Solves #4

HeapSet allows a basic heap interface while maintaining only one copy of the state in the heap.
If a state is inserted more than once, the better is kept.

Memory use went down for larger search spaces after introducing this set.
Memory use went up for smaller search spaces, which should be
investigated.

Small 2x2

Before: total heap usage: 118 allocs, 118 frees, 48,803 bytes allocated
After: total heap usage: 130 allocs, 130 frees, 49,379 bytes allocated

Medium 3x3

Before: total heap usage: 26,761 allocs, 26,761 frees, 2,335,947 bytes allocated
After: total heap usage: 23,740 allocs, 23,740 frees, 2,009,883 bytes
allocated

Solves LearnProgramming#4

HeapSet allows a basic heap interface while maintaining only one copy of the state in the heap.
If a state is inserted more than once, the better is kept.

Memory use went down for larger search spaces after introducing this set.
Memory use went up for smaller search spaces, which should be
investigated.

Small 2x2
---
Before: total heap usage: 118 allocs, 118 frees, 48,803 bytes allocated
After: total heap usage: 130 allocs, 130 frees, 49,379 bytes allocated

Medium 3x3
---
Before: total heap usage: 26,761 allocs, 26,761 frees, 2,335,947 bytes allocated
After: total heap usage: 23,740 allocs, 23,740 frees, 2,009,883 bytes
allocated
jgulotta added a commit that referenced this pull request Dec 20, 2012
Use HeapSet, a combination set and priority queue
@jgulotta jgulotta merged commit 886bac4 into LearnProgramming:master Dec 20, 2012
@jgulotta jgulotta deleted the issue4-mem-use-open-set branch December 20, 2012 01:47
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.

None yet

1 participant