-
Notifications
You must be signed in to change notification settings - Fork 289
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
[experimental] Optimize memory consumption (take 2) #718
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
This optimization makes both, drop and keep, values use only 12 bits each, restricting their range of valid numbers to just 0-4095. While low, these numbers should suffice for practical use cases. If practical use cases arise that exceed these limitations we might think about new or better encodings.
This makes more sense with the planned introduction of InstructionWord as a base unit of instruction encoding.
We are going to need this for the new encoding of memory load and store as well as constant value instructions.
These are more (space-)efficient alternatives to more general constant value instructions for small integer values.
This new ConstRef instruction replaces the old Const instruction. The advantage of ConstRef is that it is possible to encode it in 3 bytes. This is a trade off since it is probably slower at execution time. To circumvent unnecessary slowdowns in common cases we introduced I32Const24 and I64Const24 instructions earlier.
BENCHMARKS
|
Codecov Report
@@ Coverage Diff @@
## master #718 +/- ##
==========================================
- Coverage 79.87% 79.02% -0.86%
==========================================
Files 101 102 +1
Lines 8479 8682 +203
==========================================
+ Hits 6773 6861 +88
- Misses 1706 1821 +115
... and 15 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
19 tasks
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 PR is based on #716.
It tries to achieve a net win by taking a compromise approach between the current state in
master
and the aforementioned PR.The compromise reduces the
size_of
ofInstruction
to 8 bytes instead of 4. This allows to avoidintx
types in most if not all places which is important since it seems that usage of those custom types caused a lot of performance regressions.