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

Replace regex approach to ls-files output parsing #544

Merged
merged 1 commit into from
Nov 26, 2023
Merged

Conversation

mih
Copy link
Member

@mih mih commented Nov 23, 2023

In #540 I found about ~10% of the runtime to be attributable to the regex-matching. This patch replaces the regex with two split() calls. In local benchmarks I see a ~10% speedup.

One major other source of slow-down was/is the construction of PurePosixPath objects. It seems this is being taken care of by python/cpython#101362 and will be resolved eventually.

Closes #540

In #540 I found about ~10% of the runtime to be attributable to the
regex-matching. This patch replaces the regex with two split()
calls. In local benchmarks I see a ~10% speedup.

One major other source of slow-down was/is the construction of
`PurePosixPath` objects. It seems this is being taken care of by
python/cpython#101362 and will be resolved
eventually.

Closes #540
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f2a6fe4) 92.66% compared to head (3b01b01) 92.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #544      +/-   ##
==========================================
- Coverage   92.66%   92.64%   -0.02%     
==========================================
  Files         137      137              
  Lines       10031    10035       +4     
  Branches     1085     1085              
==========================================
+ Hits         9295     9297       +2     
- Misses        712      714       +2     
  Partials       24       24              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@christian-monch christian-monch left a comment

Choose a reason for hiding this comment

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

LGTM

@mih
Copy link
Member Author

mih commented Nov 26, 2023

Thanks for the review!

@mih mih merged commit 230ec56 into main Nov 26, 2023
9 of 12 checks passed
@mih mih deleted the enh-gitworktree branch November 26, 2023 19:53
@mih mih added this to the 1.0.3 milestone Dec 6, 2023
@mih mih added the semver-patch PR implies patch-level version increment (API stable) label Dec 6, 2023
@mih mih modified the milestones: 1.0.3, 1.1 Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch PR implies patch-level version increment (API stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iter_gitworktree() too slow
2 participants