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

Fix performance issue with unused include diagnostics #1398

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

plux
Copy link
Contributor

@plux plux commented Nov 2, 2022

Description

Unused include diagnostic can hog the CPU if there's unreachable include files in combination with huge search path and large source files.

The issue boils down to calling file:path_open/3 on the unreachable files for every POI in the source file.
To improve the performance memoization on error was added in els_indexing:find_and_deeply_index_file/1 to avoid repeatedly calling file:path_open/3 on the same filename.

Unused include diagnostic can hog the CPU if there's
unreachable include files in combination with huge search path and
large source files.

The issue boils down to calling file:path_open/3 on the unreachable files
for every POI in the source file.
To improve the performance memoization on error was added in
els_indexing:find_and_deeply_index_file/1 to avoid repeatedly calling
file:path_open/3 on the same filename.
@robertoaloi robertoaloi merged commit e53aa6c into erlang-ls:main Nov 8, 2022
@robertoaloi
Copy link
Member

Thanks!

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