Skip to content

[NFC] Optimize ModuleUtils type-scanning code#8572

Merged
kripken merged 2 commits intoWebAssembly:mainfrom
kripken:fast.mu
Apr 7, 2026
Merged

[NFC] Optimize ModuleUtils type-scanning code#8572
kripken merged 2 commits intoWebAssembly:mainfrom
kripken:fast.mu

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Apr 3, 2026

Before, we always did a loop on type.getHeapTypeChildren() which
means setting up a scanner object and going through a generic
path. Instead, handle the common cases directly. This avoids any
generic path in the common case.

This makes us 1% faster on -O3, as measured by instruction
count, number of branches, and walltime. The noise in the first
two is incredibly small, so this looks reliably faster.

@kripken kripken requested a review from tlively April 3, 2026 18:43
@kripken kripken requested a review from a team as a code owner April 3, 2026 18:43
@kripken kripken merged commit cfa8abd into WebAssembly:main Apr 7, 2026
16 checks passed
@kripken kripken deleted the fast.mu branch April 7, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants