Improve extract performance via ignoring directories early during os.walk#968
Conversation
|
@DenverCoder1 If you have a moment, could you review this? :) |
|
Looks good to me (I haven't tested) I noticed a similar method in frontend.py - babel/babel/messages/frontend.py Lines 277 to 288 in 373a52f |
6cb29ea to
c68ca01
Compare
522e42b to
95fc9b3
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves message extraction performance by filtering out ignored directories early during the os.walk traversal, rather than checking each file individually. The implementation introduces a new directory filter factory and deprecates the old default_directory_filter function.
Key Changes:
- New
make_default_directory_filterfactory function that creates directory filters aware of ignore patterns from the method map - Deprecation of the standalone
default_directory_filterfunction with a clear warning - Refactored tests to validate both file-based ignore patterns (
**/ignored/**.*) and simple directory patterns (ignored)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8b1b28a to
8c455bb
Compare
…walk Co-authored-by: Steven Kao <st.kao.05@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Closes #694 (rebases and reimplements it)