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

Speed up exists_case_sensitive calls #2264

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

correctmost
Copy link

These changes save ~35ms when running isort on the yt-dlp codebase on Linux (~3.2secs -> 3.165secs, ~1% of the total time).

The savings should be a bit greater on Windows and macOS because repeated os.listdir calls are avoided too.

The main motivation behind these changes, however, was to speed up pylint, which relies on isort for import-order checks. When running pylint on a private codebase with ~2200 Python files, I see a reduction of ~10,000 stat calls after applying this PR.

Copy link

@akaFM akaFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change.

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