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
Fixes #7561: Use Scandir to speed up our os.walk usage #7712
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request template is to show you what kind of thing you have in the pull request - you don't need to include it directly.
Also, the instruction to do "Add Fixes #ISSUENUM at the top of your PR." means literally at the top of the comments - github doesn't parse it if you write it in the summary field.
src/olympia/amo/utils.py
Outdated
@@ -40,6 +40,7 @@ | |||
import pytz | |||
|
|||
from babel import Locale | |||
from scandir import walk as scandir_walk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just do import scandir
so you can replace os...
with scandir...
all over.
@eviljeff Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks
@eviljeff Not sure why the circle CI is failing on master and showing that |
Ah! Good call, the requirement should in prod.txt instead. |
Ah, sorry, I didn't know that. I'm sending a patch right away :) |
Thanks! (I didn't remember either - and Travis passing fooled me) |
Used scandir instead of
os.walk
to speed up usage ofwalk
method.I've imported it as
scandir_walk
to explicitly keep name-spacing consistent. This would help people in future to quickly know that it is not normal walk that is shipped withos
module.Please delete anything that isn't relevant to your patch.
PRs open for the same issue.
Fixes #ISSUENUM
at the top of your PR.Let me know if this needs any further changes ;)