Skip to content

perf(wamrc): Replace slow symbol lookup with hash map in wamrc#4912

Open
jammar1 wants to merge 1 commit intobytecodealliance:mainfrom
jammar1:mrshnja/wamrc-faster-symbol-lookup
Open

perf(wamrc): Replace slow symbol lookup with hash map in wamrc#4912
jammar1 wants to merge 1 commit intobytecodealliance:mainfrom
jammar1:mrshnja/wamrc-faster-symbol-lookup

Conversation

@jammar1
Copy link
Copy Markdown
Contributor

@jammar1 jammar1 commented Apr 13, 2026

Replace slow symbol lookup with hash map in AOT compilation.

The relocation symbol deduplication in aot_emit_aot_file.c used a linked list, requiring O(n) traversal per relocation to check for duplicates.

Replace with a lazily-allocated hash map for O(1) lookups. The linked list is preserved for ordered iteration during emission.

When testing against a fairly large Wasm binary (about 18MB) this reduced compilation time by about ~15%.

…ion/emission

The relocation symbol deduplication in aot_emit_aot_file.c used a linked
list, requiring O(n) traversal per relocation to check for duplicates.

Replace with a lazily-allocated hash map for O(1) lookups.
The linked list is preserved for ordered iteration during emission.
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