René's URL Explorer Experiment


Title: Update importlib locking to CPython 3.15.2 (performance review needed) by youknowdot · Pull Request #9899 · RustPython/RustPython · GitHub

Open Graph Title: Update importlib locking to CPython 3.15.2 (performance review needed) by youknowdot · Pull Request #9899 · RustPython/RustPython

X Title: Update importlib locking to CPython 3.15.2 (performance review needed) by youknowdot · Pull Request #9899 · RustPython/RustPython

Description: Summary Update importlib and its canonical package/threaded tests with scripts/update_lib from CPython v3.15.2. This replaces the local hierarchical-lock manager with upstream parent resolution and per-module waits, includes upstream import-audit ordering, and handles __main__.__spec__ is None in loader lookup. Existing RustPython test adaptations are preserved. No Rust/dependency/CI changes or new project-specific tests. The new canonical test_parent_lock_not_held_while_submodule_executes fails on the previous frozen RustPython bootstrap (the parent lock is still held), and passes with this rebuilt bootstrap. The canonical threaded tests also cover failed imports, circular imports, parent removal, and retry races. Verification A fresh isolated release build was made so these results exercise the updated frozen bootstrap, not just source files: RustPython full test_importlib: 1,236 tests run, 109 skipped, suite passed with existing markers. RustPython test_import, test_pkgutil, test_audit: 183 tests run, 59 skipped, suites passed with existing markers. C-extension audit paths remain limited by unavailable _testcapi. RustPython canonical threaded-import module: 26 tests run, 5 skipped, passed. CPython 3.15.2 canonical threaded reference: 26 tests run, 5 skipped, passed. Source-focused lock/package/util checks: 172 tests run, 7 skipped. Commit hooks and git diff --check passed. Fresh workspace/C-API tests and Clippy were not run for this Python-only change; Windows/macOS validation awaits CI. Performance review needed Keep this a draft, not a no-regression performance claim. Alternating local release-binary measurements of 300,000 warm-cache operations (five pairs) showed: Microbenchmark Previous bootstrap median Updated bootstrap median Change __import__('json.decoder') 0.2038 s 0.2133 s +4.6% importlib.import_module('json.decoder') 0.8805 s 0.9767 s +10.9% The earlier shorter seven-pair run also showed a warm-path slowdown. These are narrow local measurements, not application-wide or cross-platform benchmarks. The new Python _is_initializing() helper is a possible contributor, not yet proven. I have not rewritten the upstream algorithm to conceal the tradeoff. Correctness improves, but the warm-import cost needs review before merge.

Open Graph Description: Summary Update importlib and its canonical package/threaded tests with scripts/update_lib from CPython v3.15.2. This replaces the local hierarchical-lock manager with upstream parent resolution and...

X Description: Summary Update importlib and its canonical package/threaded tests with scripts/update_lib from CPython v3.15.2. This replaces the local hierarchical-lock manager with upstream parent resolution and...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9899

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e8e9cc30-3d62-3acc-a55e-bc39b007fd1c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCE66:361639:2E4C337:3DCE4C9:6B01DE4D
html-safe-noncef02e29d420b98b3c0f4ad524d5dbecdf7f937c62f148572b13419fc50bfc4d4f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTY2OjM2MTYzOToyRTRDMzM3OjNEQ0U0Qzk6NkIwMURFNEQiLCJ2aXNpdG9yX2lkIjoiNzMxNTY3NzAyODk2NjA2MzY5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac077c03c788af6c3f6ac3701dbc0fc630c741d8bc43a6c470bbf6783c49b6351e
hovercard-subject-tagpull_request:5349016600
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///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9899/files
twitter:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
og:image:altSummary Update importlib and its canonical package/threaded tests with scripts/update_lib from CPython v3.15.2. This replaces the local hierarchical-lock manager with upstream parent resolution and...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9899/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9899%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9899%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9899/files
Reloadhttps://github.com/RustPython/RustPython/pull/9899/files
Reloadhttps://github.com/RustPython/RustPython/pull/9899/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowdot:update/importlib-3152-20261117https://github.com/youknowdot/RustPython/tree/update/importlib-3152-20261117
Conversation 4 https://github.com/RustPython/RustPython/pull/9899
Commits 1 https://github.com/RustPython/RustPython/pull/9899/commits
Checks 21 https://github.com/RustPython/RustPython/pull/9899/checks
Files changed https://github.com/RustPython/RustPython/pull/9899/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9899/files
Update importlib locking to CPython 3.15.2 (performance review needed) https://github.com/RustPython/RustPython/pull/9899/files#top
Show all changes 1 commit https://github.com/RustPython/RustPython/pull/9899/files
53ed7fd Update importlib locking and package tests to CPython 3.15.2 codex Nov 17, 2026 https://github.com/RustPython/RustPython/pull/9899/commits/53ed7fd581f0bc75bb43867cad3f9607e983e78e
Clear filters https://github.com/RustPython/RustPython/pull/9899/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9899/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9899/files
_bootstrap.py https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
_bootstrap_external.py https://github.com/RustPython/RustPython/pull/9899/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
test_packages.py https://github.com/RustPython/RustPython/pull/9899/files#diff-ae90d99527180da8a998364071ed5fac8db7b6fb3ae2b032fc8fc1328e8d6046
test_threaded_import.py https://github.com/RustPython/RustPython/pull/9899/files#diff-a1e554f578aaaf3a7232078affdd527a19c86b178d8e3df84de287d335804ab1
Lib/importlib/_bootstrap.pyhttps://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
View file https://github.com/youknowdot/RustPython/blob/53ed7fd581f0bc75bb43867cad3f9607e983e78e/Lib/importlib/_bootstrap.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9899/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
https://github.com/RustPython/RustPython/pull/9899/files#diff-dba786ae26d5505c4c367a93b1179c2f80f2433d983b84bacb9001fb552f0761
Lib/importlib/_bootstrap_external.pyhttps://github.com/RustPython/RustPython/pull/9899/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
View file https://github.com/youknowdot/RustPython/blob/53ed7fd581f0bc75bb43867cad3f9607e983e78e/Lib/importlib/_bootstrap_external.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9899/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9899/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
https://github.com/RustPython/RustPython/pull/9899/files#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4
Lib/test/test_importlib/import_/test_packages.pyhttps://github.com/RustPython/RustPython/pull/9899/files#diff-ae90d99527180da8a998364071ed5fac8db7b6fb3ae2b032fc8fc1328e8d6046
View file https://github.com/youknowdot/RustPython/blob/53ed7fd581f0bc75bb43867cad3f9607e983e78e/Lib/test/test_importlib/import_/test_packages.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9899/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9899/files#diff-ae90d99527180da8a998364071ed5fac8db7b6fb3ae2b032fc8fc1328e8d6046
https://github.com/RustPython/RustPython/pull/9899/files#diff-ae90d99527180da8a998364071ed5fac8db7b6fb3ae2b032fc8fc1328e8d6046
https://github.com/RustPython/RustPython/pull/9899/files#diff-ae90d99527180da8a998364071ed5fac8db7b6fb3ae2b032fc8fc1328e8d6046
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9899/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9899/files
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.