Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-117394: Speed up os.path.ismount() on Posix#117447

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedApr 2, 2024
edited by bedevere-appbot
Loading

It is now 2-3 times faster if the user has permissions.

It is now 2-3 times faster if the user has permissions.
@nineteendo
Copy link
Contributor

nineteendo commentedApr 3, 2024
edited
Loading

Benchmark:

# test.shecho"relative"&& python -m timeit -s"import before.posixpath""before.posixpath.ismount('.')"&& python -m timeit -s"import after.posixpath""after.posixpath.ismount('.')"echo"absolute"&& python -m timeit -s"import before.posixpath""before.posixpath.ismount('/Volumes/2GB_001')"&& python -m timeit -s"import after.posixpath""after.posixpath.ismount('/Volumes/2GB_001')"echo"no permission"&& python -m timeit -s"import before.posixpath""before.posixpath.ismount('/Users/wannes/path-picker/permission-test/dirs/666')"&& python -m timeit -s"import after.posixpath""after.posixpath.ismount('/Users/wannes/path-picker/permission-test/dirs/666')"
relative10000 loops, best of 5: 27.3 usec per loop # before50000 loops, best of 5: 8.25 usec per loop # after# -> 3.29x fasterabsolute20000 loops, best of 5: 19.7 usec per loop # before50000 loops, best of 5: 8.21 usec per loop # after# -> 2.40x fasterno permission5000 loops, best of 5: 41.2 usec per loop # before5000 loops, best of 5: 48.5 usec per loop # after# -> 1.18x slower

@nineteendo
Copy link
Contributor

@erlend-aasland, could you review this?

@erlend-aasland
Copy link
Contributor

Looks good to me, but I'm not sure if it worth the added maintenance cost to optimise this. I mean, how often is theismount API used? I'll leave it for Serhiy to decide.

@serhiy-storchakaserhiy-storchaka merged commit4e502a4 intopython:mainApr 17, 2024
@serhiy-storchakaserhiy-storchaka deleted the posixpath-ismount-optimize2 branchApril 17, 2024 09:58
diegorusso pushed a commit to diegorusso/cpython that referenced this pull requestApr 17, 2024
It is now 2-3 times faster if the user has permissions.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@nineteendonineteendonineteendo approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@serhiy-storchaka@nineteendo@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp