perf(wamrc): Replace slow symbol lookup with hash map in AOT compilat…#7
Open
jammar1 wants to merge 1 commit into
Open
perf(wamrc): Replace slow symbol lookup with hash map in AOT compilat…#7jammar1 wants to merge 1 commit into
jammar1 wants to merge 1 commit into
Conversation
213fd08 to
4b4759a
Compare
…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.
4b4759a to
d08ab66
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.