-
Notifications
You must be signed in to change notification settings - Fork 57
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
introduce deserialize_backref_record() #381
Merged
Merged
Conversation
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
Pull Request Test Coverage Report for Build 7907475742Details
💛 - Coveralls |
Rigidity
previously approved these changes
Feb 13, 2024
Merged
richardkiss
reviewed
Feb 14, 2024
richardkiss
reviewed
Feb 14, 2024
richardkiss
requested changes
Feb 14, 2024
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.
Except for maybe the name of the visitor
function, looks good.
…ing back-referenced to. This helps inform, e.g. tree_hash() which nodes' hashes should be cached.
arvidn
force-pushed
the
deserialize-record
branch
from
February 14, 2024 20:40
2ba151f
to
76dd622
Compare
Rigidity
approved these changes
Feb 14, 2024
richardkiss
approved these changes
Feb 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This new function/overload records all the nodes being back-referenced to. This helps inform, e.g.
tree_hash()
which nodes' hashes should be cached.This feature enables performance improvements in
chia_rs
. Those improvements are reported below.Hashing speed-up: 5.0 - 5.85
The speed-up of hashing a whole block generator, of a full block (50% full given our current farmer fill rate). These are real blocks from mainnet, picked out during the period of high mempool pressure, and full blocks.
Generator speed-up: 1.26 - 1.88
The speed up of running the block generator of a compressed block using
run_block_generator2()
, i.e. with the rust implementation of the generator ROM. This is what enables the improved hashing of the puzzles.This speed-up won't be realized on chain until after the hard-fork.
benchmarks, MacOS M1
run_generator2
when taking advantage of this information exported from the deserializer, we can optimize
tree_hash()
and also optimize the tree hashing inrun_block_generator2()
.Since the cache takes advantage of the block being "compressed" (i.e. using clvm backrefs), it won't impact uncompressed blocks.
tree_hash_from_bytes
The
tree_hash_from_bytes()
function, when updated to use a cache, has the following benchmarks. Again, only the compressed CLVM would improve.profile
This is where we spend time in the
run_generator
test. This is test caseblock-1ee588dc
run in Linux, AMD Threadripper. The test runs both the regularrun_block_generator()
(which uses the CLVM implememtation of the ROM) as well asrun_block_generator2()
, with the rust implementation of the ROM.uncompressed blocks
For reference, here are the benchmarks for the uncompressed blocks. These are not expected to gain a boost: