Merge lp:~gz/bzr-grep/no_match_fast_path into lp:bzr-grep
Proposed by
Martin Packman
Status: | Merged |
---|---|
Approved by: | Parth Malwankar |
Approved revision: | 157 |
Merged at revision: | 139 |
Proposed branch: | lp:~gz/bzr-grep/no_match_fast_path |
Merge into: | lp:bzr-grep |
Prerequisite: | lp:~gz/bzr-grep/preformat_output |
Diff against target: |
156 lines (+67/-15) 4 files modified
NEWS (+6/-0) __init__.py (+2/-2) grep.py (+53/-13) test_grep.py (+6/-0) |
To merge this branch: | bzr merge lp:~gz/bzr-grep/no_match_fast_path |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Parth Malwankar | Approve | ||
Review via email:
|
Description of the change
Optimisation, avoids splitting the text into a list of lines and testing each one for a match. There are actually a couple of cases where we have avoid this anyway, as explained in the comments, and currently always fall back to splitting into lines after a match is found.
Timings of most interest here will be a big tree with only a few files hit by the pattern.
To post a comment you must log in.
This is a really neat optimization. Thanks.
The hot cache numbers for emacs tree working tree search go from 2.39-2.42s to 0.93-0.96s for a pattern thats not found. One we merge in the prerequisite branch we can merge this in. Please add a NEWS entry.