Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a slice for InstMap instead of std.HashMap #13650

Merged
merged 1 commit into from
Nov 27, 2022

Conversation

Hejsil
Copy link
Contributor

@Hejsil Hejsil commented Nov 25, 2022

Reviving MR #11977

The `sema.inst_map` datastructure is very often accessed. All
instructions that reference the result of other instructions does a
lookup into this field. Because of this, a significant amount of time,
is spent in `std.HashMap.get`.

This commit replaces the `HashMap` with a simpler data structure that
uses the zir indexes to index into a slice for the result. See the data
structure doc comment for more info.
@andrewrk andrewrk merged commit 6097165 into ziglang:master Nov 27, 2022
@Hejsil Hejsil deleted the faster-inst-map branch November 27, 2022 09:56
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