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

Speedup get_plugin_linter_classes #59

Merged
merged 1 commit into from Mar 9, 2023
Merged

Conversation

jogo
Copy link
Contributor

@jogo jogo commented Mar 8, 2023

get_plugin_linter_classes is called once per file being processed and can take hundreds of ms per file, which over a large code base of hundreds or thousands of files slows things down noticeably. use an lru_cache here as the code should always return the same thing inside a single process.

Closes #58

get_plugin_linter_classes is  called once per file being processed and
can take hundreds of ms per file, which over a large code base of
hundreds or thousands of files slows things down noticeably. use an
lru_cache here as the code should always return the same thing inside a
single process.
@mschwager
Copy link
Contributor

Nice find! Thank you!

@mschwager mschwager merged commit 01b5df7 into dlint-py:master Mar 9, 2023
@mschwager
Copy link
Contributor

Just a heads up - I released 0.14.1 with this change: https://pypi.org/project/dlint/0.14.1/. I held off on releasing to see if any other fixes/improvements would come up 👍

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.

pkgutil.iter_modules is evaluated once per module
2 participants