-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
GH-112727: Speed up pathlib.Path.absolute()
#112728
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
Conversation
Use `_from_parsed_parts()` to create a pre-joined/pre-parsed path, rather than passing multiple arguments to `with_segments()`
1.5x speedup for paths with tail segments:
It would be interesting to also test the performance of |
Big speedups on Windows! On
With PR:
(Timings done using a reasonably fresh PGO-optimised build) |
I can also repro all your reported speedups from #112728 (comment)! |
Co-authored-by: Alex Waygood <[email protected]>
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.
LGTM
Thanks tons! |
Use `_from_parsed_parts()` to create a pre-joined/pre-parsed path, rather than passing multiple arguments to `with_segments()` Co-authored-by: Alex Waygood <[email protected]>
Use `_from_parsed_parts()` to create a pre-joined/pre-parsed path, rather than passing multiple arguments to `with_segments()` Co-authored-by: Alex Waygood <[email protected]>
Use
_from_parsed_parts()
to create a pre-joined/pre-parsed path, rather than passing multiple arguments towith_segments()
pathlib.Path.absolute()
#112727