Use boost::unordered_map for mapBlockIndex#4838
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.
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.
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.
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: