Skip to content

[NFC] Optimize ModuleUtils type-scanning code#8572

Open
kripken wants to merge 2 commits intoWebAssembly:mainfrom
kripken:fast.mu
Open

[NFC] Optimize ModuleUtils type-scanning code#8572
kripken wants to merge 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
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.

1 participant