-
Notifications
You must be signed in to change notification settings - Fork 123
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
[TEMP ON HOLD] refactor: Use SBOR raw value across engine for better worst case performance #1860
Draft
dhedey
wants to merge
11
commits into
develop
Choose a base branch
from
refactor/use-sbor-raw-value-in-engine
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
Benchmark for bd69b0eClick to view benchmark
|
Docker tags |
dhedey
force-pushed
the
refactor/use-sbor-raw-value-in-engine
branch
from
July 26, 2024 23:18
5c69067
to
21877eb
Compare
dhedey
force-pushed
the
refactor/use-sbor-raw-value-in-engine
branch
from
August 7, 2024 23:29
6c066ac
to
5e80b55
Compare
dhedey
added a commit
that referenced
this pull request
Aug 9, 2024
benches: Explicit benches relevant to #1860
This was referenced Aug 15, 2024
dhedey
changed the title
refactor: Use SBOR raw value across engine for better worst case performance
[TEMP ON HOLD] refactor: Use SBOR raw value across engine for better worst case performance
Sep 25, 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.
Note
This PR is massive and never quite got finished or reviewed and now has a mountain of merge conflicts. Instead, I suggest we proceed by:
Summary
Looks to address #1708 and historic issues with
ScryptoValue
- by replacingScryptoValue
with variants ofScryptoRawValue
on the critical paths in the engine.Notably, compare these benchmarks from #1870 with after this PR:
This is due to quite a few places in the System layer where we were decoding as
ScryptoValue
as the value part of System wrappers. We've knownScryptoValue
can be very slow to decode for a while; particularlyVec<u8>
. And whilst we should improve that (as Bartosz recommends), usingScryptoRawValue
should be faster/safer.Instead:
ScryptoRawValue
/ScryptoRawPayload
, which decodes much more quickly in the common worst case of largeVec<u8>
.Vec<u8>
flying around, we now have concrete new types for whether things have been validated or not.IndexedOwnedScryptoValue
fromIndexedScryptoValue<'a>
where the latter doesn't necessarily own its value.Still to come:
FieldValue
andKVEntry
to beScryptoUnvalidatedOwnedRawPayload
and fixSystemObjectApi
etc (git stash pop
)SborUnvalidatedOwnedRawPayload
instead ofSborUnvalidatedOwnedRawValue
SborRawValue
and check it when encodingSborRawValue
/SborRawPayload
SborRawPayload
when encoding assbor_raw_payload
so it can be converted more performantly toSborRawValue
.traverser
/calculate_value_tree_body_byte_length
as best we can to eek out even more performance.Details
TODO
Testing
Unit tests on
encoded_wrappers.rs
to comeUpdate Recommendations
TODO