👀 seeing a potential 9% global speedup in Bitcoin Core, coincident with a 8% reduction in memory usage thanks to 's good work on hashmaps. github.com/bitcoin/bitcoi
Conversation
Replying to
Backstory: two years ago, I ran some profiling and found (unsurprisingly) that a big bottleneck in Bitcoin performance is accessing the UTXO set. I experimented with swapping out the data structure that facilitates this access and got some good results. github.com/bitcoin/bitcoi
1
23
In a nutshell, Bitcoin at the moment uses a very well-tested but very general hashmap implementation for the in-memory coins cache (std::unordered_map). I thought we could do better with a more specialized implementation. And we did.
1
18
The problem is that this specialized hashmap implementation would add about two thousand lines of new consensus-critical code, which is something that requires a ton of scrutiny and testing. The failure modes are also less straightforward than the standard map we use now.
1
16
Luckily, has isolated an important subset of these changes: the parts that handle memory allocation, which is an always-expensive part of data structure management. This bit of the change is safer to use and easier to reason about.
1
17
So, is going to resurrect these changes in a new PR, do a bunch of review, and if they turn out to be safe Bitcoin might just get a nice bump in performance.
1
31
Show replies
Show replies



