-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Use boost::unordered_map for mapBlockIndex #4838
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
Conversation
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4838_1e4f87f5a13e34a457b537e9d13a212e6c5b754f/ for binaries and test log. |
|
Looks good to me, utACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong feeling on this, but I slightly prefer passing this explicitly as it documents what input is used to the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not possible. Checkpoints and main are a circular dependency, only possible now because checkpoints.h doesn't need main.h. If the type of mapBlockIndex is defined in main.h, it becomes an actual .h circular dependency.
Better solution: move the code pieces of checkpoints to main, and the data pieces to chainparams...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, clear.
#3802 does that data move, by the way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It moves the data but does not break the cyclic dependency.
|
I tested out most of the same change last weekend in the hope it would decrease memory usage (it didn't). I liked the effect on the code (esp, getting rid of the explicit types for a typedef, is 99% of the work here and should be done regardless). ACK (with quasi-testing, I tested my nearly identical changes) |
|
ut ACK |
As some profiling by @kdomanski showed that we're doing a very high amount of calls to uint256::CompareTo, in particular for mapBlockIndex operations. So: