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

Improve macro refs performance #1476

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Improve macro refs performance #1476

merged 2 commits into from
Jan 10, 2024

Conversation

plux
Copy link
Contributor

@plux plux commented Jan 9, 2024

Description

Improve performance of looking up references to macros/records.

Finding scoped references can be done in two ways:

  • Naive, find all POIs that can reach our POI and matches the id.

  • Indexed, use the index to find all matching POIs, then check if
    they actually reference our POI by using goto_definition.

It varies from case to case which is the fastest, so we race both
functions to get the quickest answer.

Fixes #1309.

Use index to find references instead of traversing all files that
includes a header.
@plux plux force-pushed the improve-macro-refs-performance branch 5 times, most recently from 64fca3c to abed698 Compare January 10, 2024 10:15
Finding scoped references can be done in two ways:

  * Naive, find all POIs that can reach our POI and matches the id.

  * Indexed, use the index to find all matching POIs, then check if
    they actually reference our POI by using goto_definition.

It varies from case to case which is the fastest, so we race both
functions to get the quickest answer.
@plux plux force-pushed the improve-macro-refs-performance branch from abed698 to 9658f1f Compare January 10, 2024 12:47
@plux plux merged commit daaea65 into main Jan 10, 2024
9 of 12 checks passed
@plux plux deleted the improve-macro-refs-performance branch January 10, 2024 13:25
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.

Goto macro definition is too slow
1 participant