Skip to content

perf(wamrc): Replace slow symbol lookup with hash map in AOT compilat…#7

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

perf(wamrc): Replace slow symbol lookup with hash map in AOT compilat…#7
jammar1 wants to merge 1 commit into
mainfrom
mrshnja/wamrc-faster-symbol-lookup

Conversation

@jammar1
Copy link
Copy Markdown
Owner

@jammar1 jammar1 commented Apr 13, 2026

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.

Also add a sorted section address cache with binary search for O(log n) symbol-to-section resolution, replacing per-symbol O(n) linear scans via LLVMMoveToContainingSection in aot_resolve_functions and aot_resolve_object_relocation_group.

@jammar1 jammar1 force-pushed the mrshnja/wamrc-faster-symbol-lookup branch 3 times, most recently from 213fd08 to 4b4759a Compare April 13, 2026 14:38
…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.
@jammar1 jammar1 force-pushed the mrshnja/wamrc-faster-symbol-lookup branch from 4b4759a to d08ab66 Compare April 13, 2026 14:49
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