fitzgen opened PR #13495 from fitzgen:wasmtime-inline-trace-info-in-object-header to bytecodealliance:main:
We have a number of available bits inside the
VMGcHeader. This commit uses them to bitpack the following type:pub enum InlineTraceInfo { /// The trace info is not encoded inline. Look it up from `TraceInfos`. OutOfLine, /// Inline trace info for an array type. Array { /// Whether the array's elements are GC references that need tracing. elems_are_gc_refs: bool, }, /// Inline trace info for a struct, exception, or externref type. Struct { /// A bitmap where the `i`th bit is set iff the `i`th `u32` in the /// object's data (after the header) is a `VMGcRef` that needs /// tracing. Only the lower 23 bits are meaningful. gc_ref_bitmap: u32, }, }This allows us to encode the majority of objects' GC edges inline in the GC object header, avoiding the need to perform expensive hash map lookups in the common case.
This results in a 7-8% speed up on
splay.wasmin Sightglass:execution :: cycles :: benchmarks/splay/splay.wasm Δ = 5858240.88 ± 445613.91 (confidence = 99%) inline-trace-info.dylib (-Ccollector=copying -Wgc,function-references) is 1.07x to 1.08x faster than main.dylib (-Ccollector=copying -Wgc,function-references)! [77193983 79604574.70 88386948] inline-trace-info.dylib (-Ccollector=copying -Wgc,function-references) [83057364 85462815.58 92545612] main.dylib (-Ccollector=copying -Wgc,function-references)<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested cfallin for a review on PR #13495.
fitzgen requested wasmtime-compiler-reviewers for a review on PR #13495.
fitzgen requested wasmtime-core-reviewers for a review on PR #13495.
fitzgen updated PR #13495.
:thumbs_up: alexcrichton submitted PR review.
github-actions[bot] added the label wasmtime:api on PR #13495.
github-actions[bot] added the label wasmtime:ref-types on PR #13495.
github-actions[bot] commented on PR #13495:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"Thus the following users have been cc'd because of the following labels:
- fitzgen: wasmtime:ref-types
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
fitzgen updated PR #13495.
fitzgen has enabled auto merge for PR #13495.
fitzgen added PR #13495 Copying collector: Store most tracing info inline in the object header to the merge queue.
fitzgen updated PR #13495.
fitzgen removed PR #13495 Copying collector: Store most tracing info inline in the object header from the merge queue.
fitzgen has enabled auto merge for PR #13495.
fitzgen added PR #13495 Copying collector: Store most tracing info inline in the object header to the merge queue.
:check: fitzgen merged PR #13495.
fitzgen removed PR #13495 Copying collector: Store most tracing info inline in the object header from the merge queue.
Last updated: Jun 01 2026 at 09:49 UTC