-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: Use new uint256 for work sums.
Live profiling data of performing an initial sync shows that roughly 36% of all in-use allocations are the result of the big integers used to store the cumulative work for each block. Further, around 12% of the entire CPU time is spent scaning the heap for garbage collection which is a direct result of the total number of inuse allocations. Therefore, a reasonable expectation is that eliminating those heap objects should produce a speedup of around 4-5%. Consequently, this modifies the blockchain package to make use of the much more efficient zero-alloc uint256s and associated work calculation funcs in the new primitives package that is under development. Profiling shows the result is about 100MiB less heap usage on average and a reduction of about 5% to the initial sync time which is in line with the expected result.
- Loading branch information
Showing
6 changed files
with
86 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.