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

Optimize name resolution in desugaring #3586

Merged
merged 7 commits into from
Oct 18, 2024
Merged

Conversation

nikswamy
Copy link
Collaborator

Another fix prompted by @LukeXuan (thanks!)

Resolving names during desugaring involved a linear scan of a list of names in scope.

For modules with a large number of definitions, this exposes quadratic behavior in desugaring.

This PR fixes the problem by coalescing streaks of local bindings and top-level definitions in the environment into maps for faster lookup.

@nikswamy nikswamy merged commit 80e3727 into master Oct 18, 2024
2 checks passed
@nikswamy nikswamy deleted the _nik_cache_dsenv_lookup branch October 18, 2024 19:12
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