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
Separate RTS Builds (Incremental and Non-Incremental GC) #3913
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
Co-authored-by: Claudio Russo <claudio@dfinity.org>
Co-authored-by: Claudio Russo <claudio@dfinity.org>
…otoko into luc/forwarding_pointer
Based on the GC random tests.
Based on GC random tests
crusso
reviewed
May 10, 2023
crusso
reviewed
May 10, 2023
crusso
reviewed
May 10, 2023
crusso
reviewed
May 10, 2023
crusso
approved these changes
May 10, 2023
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.
But don't forget to fix those uses of physical equality
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.
Separate RTS Builds (Incremental and Non-Incremental GC)
Using different memory layouts determined at compile time:
Runtime System Changes
Separate RTS builds by introducing the feature
"incremental_gc"
for incremental GC memory layout.Helper macros:
#[incremental_gc]
: macro attribute, equivalent to#[cfg(feature = "incremental_gc")]
#[non_incremental_gc]
: macro attribute, equivalent to#[cfg(not(feature = "incremental_gc"))]
is_incremental_gc!()
: procedure macros, equivalent tocfg!(feature = "incremental_gc")
Different builds:
rts.wasm
: Release build with non-incremental GCs (containing the copying, compacting, and generational GC).rts-debug.wasm
: Debug build with non-incremental GCs (containing the copying, compacting, and generational GC).rts-incremental.wasm
: Release build with only the incremental GC (no other GCs).rts-incremental-debug.wasm
: Debug build with only the incremental GC (no other GCs).Compiler Changes
GC-dependent compilation:
Switch based on the condition
!Flags.gc_strategy == Flags.Incremental
.Performance
Comparing the the following designs:
master branch
without incremental GC changes.Binary Size
Size of the release RTS binary files.
11% reduction.
Total allocations
GC benchmark results with
dfx 0.13.1
.Total amount of allocated memory (heap size + reclaimed memory) at runtime, average across benchmark cases.
For non-incremental GCs: 8% reduction compared to the combined RTS, same like non-incremental RTS.
Memory Size
GC benchmark results with
dfx 0.13.1
.Allocated WASM memory size at runtime, average across benchmark cases.
For non-incremental GCs: 4% reduction compared to the combined RTS, same like non-incremental RTS.
Total Instructions
GC benchmark results with
dfx 0.13.1
.Number of executed instructions, average across benchmark cases.
For non-incremental GCs: Around 2% reduction compared to combined RTS, around 1%* overhead compared to non-incremental RTS.
Conclusion
Advantages of this PR: