|
|
Created:
4 years, 3 months ago by ncarter (slow) Modified:
4 years, 3 months ago CC:
chromium-reviews, dpranke+depot_tools_chromium.org, iannucci+depot_tools_chromium.org Target Ref:
refs/heads/master Project:
depot_tools Visibility:
Public. |
Descriptionowners.py: partial fix for owners-check perf regression
fnmatch.fnmatch seems to fall off a performance cliff once you start cycling through more patterns than can fit in its internal cache.
BUG=642793
Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/7e16cf303221bbcf81d632924e19ddc888da9c3b
Patch Set 1 #
Total comments: 2
Patch Set 2 : Ready for upload. #Messages
Total messages: 20 (11 generated)
nick@chromium.org changed reviewers: + dpranke@google.com, dtu@chromium.org
This is still experimental, and i don't fully understand how owners.py works, just hoping to have a discussion here. https://codereview.chromium.org/2293233002/diff/1/owners.py File owners.py (right): https://codereview.chromium.org/2293233002/diff/1/owners.py#newcode184 owners.py:184: while not self._owners_for(dirpath): I wonder if this check needs something like what happened with load_data_needed_for(). It seems odd to ever call _owners_for() on a dirname (versus a full file path), since the glob rules in OWNERS files are meant to pertain to files, not dirs.
Forgive me if I don't really know what's going on with this code either -- I think it's been a while since anyone has looked at it :) Thankfully, I think the unit tests in the tests/ directory are decent. https://codereview.chromium.org/2293233002/diff/1/owners.py File owners.py (right): https://codereview.chromium.org/2293233002/diff/1/owners.py#newcode194 owners.py:194: while dirpath not in loaded_dirs: Is loaded_dirs supposed to be at the top-level? I think as written it runs until loaded_dirs becomes '', so this is the same as doing "while dirpath:" "while dirpath:" would still be correct here. If it's faster than the current check, then that's an easy change to make for both this function and _enclosing_dir_with_owners.
Please take another look. It turns out that just caching the fnmatch regexes suffices to get most of the perf back (it gets us back to ~600ms for my original CL, which is probably okay ish for a large CL). There are opportunities to speed that up some more, but I encountered some correctness issues with the existing code (bug 643390) that we should fix first.
Description was changed from ========== owners.py: partial fix for owners-check perf regression load_data_needed_for() doesn't need seem to need to do glob computations it's just trying to hit each OWNERS file once. BUG= ========== to ========== owners.py: partial fix for owners-check perf regression load_data_needed_for() doesn't need seem to need to do glob computations it's just trying to hit each OWNERS file once. BUG=642793 ==========
Description was changed from ========== owners.py: partial fix for owners-check perf regression load_data_needed_for() doesn't need seem to need to do glob computations it's just trying to hit each OWNERS file once. BUG=642793 ========== to ========== owners.py: partial fix for owners-check perf regression fnmatch.fnmatch seems to fall off a performance cliff once you start exhausting an internal cache. BUG=642793 ==========
Description was changed from ========== owners.py: partial fix for owners-check perf regression fnmatch.fnmatch seems to fall off a performance cliff once you start exhausting an internal cache. BUG=642793 ========== to ========== owners.py: partial fix for owners-check perf regression fnmatch.fnmatch seems to fall off a performance cliff once you start cycling through more patterns than can fit in its internal cache. BUG=642793 ==========
lgtm
The CQ bit was checked by nick@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
dpranke: ping
dpranke@chromium.org changed reviewers: + dpranke@chromium.org
I'm sorry for the delay in this. I was OOO for a while, and then I was busy getting caught up after being out and procrastinating b/c I thought this change would be hard; I didn't realize you had simplified things so much. This LGTM. Thanks!
No worries, we've all been there.
The CQ bit was checked by nick@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== owners.py: partial fix for owners-check perf regression fnmatch.fnmatch seems to fall off a performance cliff once you start cycling through more patterns than can fit in its internal cache. BUG=642793 ========== to ========== owners.py: partial fix for owners-check perf regression fnmatch.fnmatch seems to fall off a performance cliff once you start cycling through more patterns than can fit in its internal cache. BUG=642793 Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/7e16cf303221bb... ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/tools/depot_tools/+/7e16cf303221bb... |