-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Improve performance of os.join by replacing map with a direct method call #117648
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
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Comments
@nineteendo Is this something you are interested in to implement? |
Yeah, I'll make another PR. :-) For -for p in map(os.fspath, paths):
+for p in paths:
p_drive, p_root, p_path = splitroot(p) |
erlend-aasland
pushed a commit
that referenced
this issue
Apr 9, 2024
Replace map() with a method call in the loop body. Co-authored-by: Pieter Eendebak <[email protected]>
This was referenced Apr 9, 2024
erlend-aasland
added a commit
that referenced
this issue
Apr 9, 2024
Make the wording more vague; the performance impact varies a lot depending on platform and input.
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
Replace map() with a method call in the loop body. Co-authored-by: Pieter Eendebak <[email protected]>
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
Make the wording more vague; the performance impact varies a lot depending on platform and input.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
We can improve performance of
os.join
by changinginto
The
map
generator takes time to create and the application of the method to each element also takes some time. A quick benchmarkThe idea still needs to be tested on other platforms and with longer sequences.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: