René's URL Explorer Experiment


Title: GH-101362: Optimise pathlib by deferring path normalisation by barneygale · Pull Request #101560 · python/cpython · GitHub

Open Graph Title: GH-101362: Optimise pathlib by deferring path normalisation by barneygale · Pull Request #101560 · python/cpython

X Title: GH-101362: Optimise pathlib by deferring path normalisation by barneygale · Pull Request #101560 · python/cpython

Description: PurePath now normalises and splits paths only when necessary, e.g. when .name or .parent is accessed. The result is cached. This speeds up path object construction by around 4x. PurePath.__fspath__...

Open Graph Description: PurePath now normalises and splits paths only when necessary, e.g. when .name or .parent is accessed. The result is cached. This speeds up path object construction by around 4x. PurePath.__fspath__...

X Description: PurePath now normalises and splits paths only when necessary, e.g. when .name or .parent is accessed. The result is cached. This speeds up path object construction by around 4x. PurePath.__fspath__...

Opengraph URL: https://github.com/python/cpython/pull/101560

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:216d2b0f-6af4-b4fa-9e75-dc4d8678c603
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC55C:247F51:F246B9:145043C:69699084
html-safe-noncefad6f595328cf6682fccc8bad26e7c666dd8ee7e4f5ded6041d9ed3e4465f09b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTVDOjI0N0Y1MTpGMjQ2Qjk6MTQ1MDQzQzo2OTY5OTA4NCIsInZpc2l0b3JfaWQiOiI5MDcyNzQxOTUyMDk1MDk2OTY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac55b60e82e83397161f841d93272eb9f3fcfd4fdc304fdb90ffac4b6defdf7659
hovercard-subject-tagpull_request:1229157490
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/101560/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/f958028736aefaf20d5c2af2440cb5487f858eae45541dc4cff3194cc97bd3fe/python/cpython/pull/101560
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f958028736aefaf20d5c2af2440cb5487f858eae45541dc4cff3194cc97bd3fe/python/cpython/pull/101560
og:image:altPurePath now normalises and splits paths only when necessary, e.g. when .name or .parent is accessed. The result is cached. This speeds up path object construction by around 4x. PurePath.__fspath__...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebarneygale
hostnamegithub.com
expected-hostnamegithub.com
None3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseaf80af7cc9e3de9c336f18b208a600950a3c187c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/101560#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101560
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101560
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/101560
Reloadhttps://github.com/python/cpython/pull/101560
Reloadhttps://github.com/python/cpython/pull/101560
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/101560
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/101560
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://github.com/python/cpython/pull/101560#issue-comment-box
barneygalehttps://github.com/barneygale
python:mainhttps://github.com/python/cpython/tree/main
barneygale:optimize-pathlib-part-2bhttps://github.com/barneygale/cpython/tree/optimize-pathlib-part-2b
GH-101362: Optimise pathlib by deferring path normalisation https://github.com/python/cpython/pull/101560#top
barneygalehttps://github.com/barneygale
python:mainhttps://github.com/python/cpython/tree/main
barneygale:optimize-pathlib-part-2bhttps://github.com/barneygale/cpython/tree/optimize-pathlib-part-2b
Conversation 5 https://github.com/python/cpython/pull/101560
Commits 16 https://github.com/python/cpython/pull/101560/commits
Checks 0 https://github.com/python/cpython/pull/101560/checks
Files changed https://github.com/python/cpython/pull/101560/files
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Feb 4, 2023https://github.com/python/cpython/pull/101560#issue-1571002682
Please reload this pagehttps://github.com/python/cpython/pull/101560
GH-76846https://github.com/python/cpython/issues/76846
GH-85281https://github.com/python/cpython/issues/85281
Optimize pathlib path construction #101362https://github.com/python/cpython/issues/101362
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
pythonGH-101362https://github.com/python/cpython/issues/101362
- Optimise pathlib by deferring path normalisationhttps://github.com/python/cpython/pull/101560/commits/b428069b063d7641d721f1cf399c086f7e3c9729
b428069https://github.com/python/cpython/pull/101560/commits/b428069b063d7641d721f1cf399c086f7e3c9729
pythonGH-76846https://github.com/python/cpython/issues/76846
pythonGH-85281https://github.com/python/cpython/issues/85281
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
Feb 4, 2023https://github.com/python/cpython/pull/101560#event-8438776292
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Feb 4, 2023 https://github.com/python/cpython/pull/101560#ref-issue-1559071717
Optimize pathlib path construction #101362 https://github.com/python/cpython/issues/101362
barneygalehttps://github.com/barneygale
February 4, 2023 16:32https://github.com/python/cpython/pull/101560#commits-pushed-e49e719
https://github.com/barneygale
Restore str force-casting behaviour; reduce diff a little.https://github.com/python/cpython/pull/101560/commits/e49e7197c18543f8b71c197b20eda7c1858dd1c2
e49e719https://github.com/python/cpython/pull/101560/commits/e49e7197c18543f8b71c197b20eda7c1858dd1c2
https://github.com/barneygale
Fix pathlib usage error in importlibhttps://github.com/python/cpython/pull/101560/commits/a931986fa440c7d8f30fdd62135983bde2b8925a
a931986https://github.com/python/cpython/pull/101560/commits/a931986fa440c7d8f30fdd62135983bde2b8925a
https://github.com/barneygale
Improve initialiser performance.https://github.com/python/cpython/pull/101560/commits/38f70bf2f785ac37bc970b7789b0f29047144af5
38f70bfhttps://github.com/python/cpython/pull/101560/commits/38f70bf2f785ac37bc970b7789b0f29047144af5
https://github.com/barneygale
Add NEWS blurbhttps://github.com/python/cpython/pull/101560/commits/10844a64085292c249aad7dbc423de6bd35caa30
10844a6https://github.com/python/cpython/pull/101560/commits/10844a64085292c249aad7dbc423de6bd35caa30
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Feb 4, 2023https://github.com/python/cpython/pull/101560#issuecomment-1416819327
Please reload this pagehttps://github.com/python/cpython/pull/101560
commenthttps://github.com/python/cpython/pull/101560#issuecomment-1455340464
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
barneygalehttps://github.com/barneygale
February 4, 2023 18:28https://github.com/python/cpython/pull/101560#event-8438996897
https://github.com/barneygale
barneygalehttps://github.com/barneygale
jaracohttps://github.com/jaraco
warsawhttps://github.com/warsaw
code ownershttps://github.com/python/cpython/blob/144aaa74bbd77aee822ee92344744dbb05aa2f30/.github/CODEOWNERS#L70
February 4, 2023 18:28https://github.com/python/cpython/pull/101560#event-8438996911
https://github.com/barneygale
barneygalehttps://github.com/barneygale
AlexWaygoodhttps://github.com/AlexWaygood
February 4, 2023 18:30https://github.com/python/cpython/pull/101560#event-8438999688
https://github.com/barneygale
Store '_fspath' as non-empty string.https://github.com/python/cpython/pull/101560/commits/d5231b666939b3edbd97bd79759619462046fb21
d5231b6https://github.com/python/cpython/pull/101560/commits/d5231b666939b3edbd97bd79759619462046fb21
https://github.com/barneygale
barneygalehttps://github.com/barneygale
February 7, 2023 20:35https://github.com/python/cpython/pull/101560#event-8461922862
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Feb 7, 2023https://github.com/python/cpython/pull/101560#issuecomment-1421424669
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
barneygalehttps://github.com/barneygale
topic-pathlib https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-pathlib
Feb 7, 2023https://github.com/python/cpython/pull/101560#event-8462994665
barneygalehttps://github.com/barneygale
March 6, 2023 02:00https://github.com/python/cpython/pull/101560#commits-pushed-76b2db7
https://github.com/barneygale
Merge branch 'main' into optimize-pathlib-part-2bhttps://github.com/python/cpython/pull/101560/commits/76b2db76bbd17047d19f5e07b5b5639a4cae6a90
76b2db7https://github.com/python/cpython/pull/101560/commits/76b2db76bbd17047d19f5e07b5b5639a4cae6a90
https://github.com/barneygale
Undo addition of __init__() and change to _from_parsed_parts()https://github.com/python/cpython/pull/101560/commits/cc2c7111d73b3b33008fe3d848d99655a249bd76
cc2c711https://github.com/python/cpython/pull/101560/commits/cc2c7111d73b3b33008fe3d848d99655a249bd76
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 6, 2023https://github.com/python/cpython/pull/101560#event-8669307439
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
Mar 6, 2023https://github.com/python/cpython/pull/101560#event-8669315231
https://github.com/barneygale
Fix pickling of paths created via walking.https://github.com/python/cpython/pull/101560/commits/cbf0fcd2890f3a0ce66bca91b8027d3432212f03
cbf0fcdhttps://github.com/python/cpython/pull/101560/commits/cbf0fcd2890f3a0ce66bca91b8027d3432212f03
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 6, 2023https://github.com/python/cpython/pull/101560#issuecomment-1455340464
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
barneygalehttps://github.com/barneygale
March 6, 2023 02:33https://github.com/python/cpython/pull/101560#event-8669449776
https://github.com/barneygale
Simplify patch slightlyhttps://github.com/python/cpython/pull/101560/commits/eb7087f7a9f44823071559ba363c8cd0579a1981
eb7087fhttps://github.com/python/cpython/pull/101560/commits/eb7087f7a9f44823071559ba363c8cd0579a1981
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 10, 2023 https://github.com/python/cpython/pull/101560#ref-pullrequest-1589980686
GH-78079: Fix UNC device path root normalization in pathlib #102003 https://github.com/python/cpython/pull/102003
barneygalehttps://github.com/barneygale
March 11, 2023 21:55https://github.com/python/cpython/pull/101560#commits-pushed-3b53e27
https://github.com/barneygale
Remove unused importhttps://github.com/python/cpython/pull/101560/commits/3b53e277b7d4eda2e87f6c51951dd0e6eebd3483
3b53e27https://github.com/python/cpython/pull/101560/commits/3b53e277b7d4eda2e87f6c51951dd0e6eebd3483
https://github.com/barneygale
Merge branch 'main' into optimize-pathlib-part-2bhttps://github.com/python/cpython/pull/101560/commits/dec98f2212f9f179d43638f2de2c44b7e644a3c8
dec98f2https://github.com/python/cpython/pull/101560/commits/dec98f2212f9f179d43638f2de2c44b7e644a3c8
https://github.com/barneygale
Fix dodgy merge, add comment about _from_parsed_parts()https://github.com/python/cpython/pull/101560/commits/d9a6080f78c2ffa1e4bc0f6c2d3171c36719c94e
d9a6080https://github.com/python/cpython/pull/101560/commits/d9a6080f78c2ffa1e4bc0f6c2d3171c36719c94e
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 11, 2023https://github.com/python/cpython/pull/101560#issuecomment-1465049737
pathlib strips trailing slash #65238https://github.com/python/cpython/issues/65238
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
barneygalehttps://github.com/barneygale
March 11, 2023 23:32https://github.com/python/cpython/pull/101560#event-8724798336
GH-101362: Omit path anchor from pathlib.PurePath()._parts #102476 https://github.com/python/cpython/pull/102476
pathlib strips trailing slash #65238 https://github.com/python/cpython/issues/65238
barneygalehttps://github.com/barneygale
March 17, 2023 15:43https://github.com/python/cpython/pull/101560#commits-pushed-9650dca
https://github.com/barneygale
Stop returning unnormalised path from __fspath__()https://github.com/python/cpython/pull/101560/commits/9650dca6ee972f8bb53198bfc7860a1e6dc510b0
9650dcahttps://github.com/python/cpython/pull/101560/commits/9650dca6ee972f8bb53198bfc7860a1e6dc510b0
https://github.com/barneygale
Merge branch 'main' into optimize-pathlib-part-2bhttps://github.com/python/cpython/pull/101560/commits/af27476ddfb77d5e62daa0f19dd6e7d5e2c325a6
af27476https://github.com/python/cpython/pull/101560/commits/af27476ddfb77d5e62daa0f19dd6e7d5e2c325a6
https://github.com/barneygale
barneygalehttps://github.com/barneygale
March 17, 2023 16:20https://github.com/python/cpython/pull/101560#event-8780206365
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 17, 2023 https://github.com/python/cpython/pull/101560#ref-issue-1629593986
Optimize pathlib.PurePath.__fspath__() #102783 https://github.com/python/cpython/issues/102783
https://github.com/barneygale
barneygalehttps://github.com/barneygale
March 17, 2023 16:45https://github.com/python/cpython/pull/101560#event-8780460680
https://github.com/barneygale
Undo change to joinpath(), fix news blurb.https://github.com/python/cpython/pull/101560/commits/97995bd2c3ea3c31bb420fab61d55b4ff0332bd0
97995bdhttps://github.com/python/cpython/pull/101560/commits/97995bd2c3ea3c31bb420fab61d55b4ff0332bd0
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 17, 2023https://github.com/python/cpython/pull/101560#issuecomment-1474303082
GH-76846, GH-85281: Call __new__() and __init__() on pathlib subclasses #102789https://github.com/python/cpython/pull/102789
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
barneygalehttps://github.com/barneygale
Mar 17, 2023https://github.com/python/cpython/pull/101560#event-8781777455
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F101560
https://github.com/jaraco
jaraco https://github.com/jaraco
https://github.com/warsaw
warsaw https://github.com/warsaw
https://github.com/AlexWaygood
AlexWaygood https://github.com/AlexWaygood
awaiting review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20review%22
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
topic-pathlib https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Atopic-pathlib
pathlib.Path._from_parsed_parts should call cls.__new__(cls) https://github.com/python/cpython/issues/76846
Please reload this pagehttps://github.com/python/cpython/pull/101560
https://github.com/barneygale
https://github.com/bedevere-bot
https://github.com/AlexWaygood
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.