-
Couldn't load subscription status.
- Fork 5.4k
Encoding/Decoding Optimizations #7419
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
Draft
xunilrj
wants to merge
32
commits into
master
Choose a base branch
from
xunilrj/encoding-optimizations
base: master
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.
Draft
Conversation
This file contains hidden or 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
187fba9 to
0fb902c
Compare
CodSpeed Performance ReportMerging #7419 will not alter performanceComparing Summary
|
5494a27 to
9e46a4e
Compare
9e46a4e to
ca4d8a3
Compare
|
good job |
8 tasks
xunilrj
added a commit
that referenced
this pull request
Oct 16, 2025
## Description This PR is a prequel for #7419. It will set the baseline, which future PRs need to improve. Apart from that it also: 1 - Fix a problem with `SubtsType` for `TyConstantDecl`; 2 - Introduce a new way to write snapshot tests. Now the test source code can have "blocks" ``` /* START BOOL */ fn in_bool(v: bool) -> bool; /* END BOOL */ ``` These blocks can be manipulated from inside the `snapshot.toml`. In this case, the `toml` is: ``` cmds = [ "forc test --path {root} --release --experimental const_generics", { repeat = "for-each-block", cmds = [ "forc test --path {root} --release --experimental const_generics" ] } ] ``` Which repeats the inner `forc test` for each block, removing all others. That allows me to check the cost of the contract method selection algorithm for each contract method. For example, `cost_of_in_array_64` with all other contract methods costs `60382`, but alone it only costs `58218`, which means that around 2000 was "wasted" in the contract method selection. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
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.
Description
This PR introduces the concept of "memcopy" for encoding/decoding.
Whena type does not have a pointer, in a lot of cases, its decoding can simply be a
memcopy. Taking advantage of this fact, we now check these cases and generate much simpler code.Checklist
Breaking*orNew Featurelabels where relevant.