René's URL Explorer Experiment


Title: gh-101282: Apply BOLT optimisations to libpython for shared builds by indygreg · Pull Request #104709 · python/cpython · GitHub

Open Graph Title: gh-101282: Apply BOLT optimisations to libpython for shared builds by indygreg · Pull Request #104709 · python/cpython

X Title: gh-101282: Apply BOLT optimisations to libpython for shared builds by indygreg · Pull Request #104709 · python/cpython

Description: (This change is a quick and dirty way to merge some of the build system improvements I'm proposing in gh-101093 before the 3.12 feature freeze. I wanted to scope bloat myself to fix some longstanding deficiencies in the build system around profile-guided builds. But I'm getting soft resistance to the reviews so close to the freeze deadline and it is obvious that we need a simpler solution to hit the 3.12 deadline. While this change is quick and dirty, it attempts to not make things worse.) Before this change, we only applied bolt to the main python binary. After this change, we apply bolt to libpython if it is configured. In shared library builds, most of the C code is in libpython so it is critical to apply bolt to libpython to realize bolt benefits. This change also reworks how bolt instrumentation is applied. It effectively removes the readelf based logic added in gh-101525 and replaces it with a mechanism that saves a copy of the pre-bolt binary and restores that copy when necessary. This allows us to perform bolt optimizations without having to manually delete the output binary to force a new bolt run. We also add a new make target for purging bolt files and hook it up to clean so bolt state is purged when appropriate. .gitignore rules have been added to ignore files related to bolt. Before and after this refactor, make will no-op after a previous run. Both versions should also share common make DAG deficiencies where targets fail to trigger as often as they need to or can trigger prematurely in certain scenarios. e.g. after this change you may need to rm profile-bolt-stamp to force a bolt run because there aren't appropriate non-phony targets for bolt's make target to depend on. Fixing this is a non-trivial amount of work that will likely have to wait until the 3.13 window. To make it easier to iterate on custom BOLT settings, the flags to pass to instrumentation and application are now defined in configure and can be overridden by passing BOLT_INSTRUMENT_FLAGS and BOLT_APPLY_FLAGS. Issue: gh-101282

Open Graph Description: (This change is a quick and dirty way to merge some of the build system improvements I'm proposing in gh-101093 before the 3.12 feature freeze. I wanted to scope bloat myself to fix some longst...

X Description: (This change is a quick and dirty way to merge some of the build system improvements I'm proposing in gh-101093 before the 3.12 feature freeze. I wanted to scope bloat myself to fix some lo...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c490cac0-2f9b-6962-12b3-c340e322031b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8B50:2EFAA1:418941:58FB7E:6969ADE0
html-safe-noncec4f1f2b66371361aef131018aa56995850cd612a044823f948e188a601d84560
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjUwOjJFRkFBMTo0MTg5NDE6NThGQjdFOjY5NjlBREUwIiwidmlzaXRvcl9pZCI6IjExODcwODUyOTk3NDU0MDIzMzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacecc9988bad38dd7787f117927f766db1b508aee958c2ce469e2b67d4ffce5a70
hovercard-subject-tagpull_request:1358068867
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/python/cpython/pull/104709/files
twitter:imagehttps://avatars.githubusercontent.com/u/342993?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/342993?s=400&v=4
og:image:alt(This change is a quick and dirty way to merge some of the build system improvements I'm proposing in gh-101093 before the 3.12 feature freeze. I wanted to scope bloat myself to fix some longst...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release124667f43168afb6c9c03b7c02eb5b1d2e1be3d9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/104709/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F104709%2Ffiles
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%2F104709%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/104709/files
Reloadhttps://github.com/python/cpython/pull/104709/files
Reloadhttps://github.com/python/cpython/pull/104709/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
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/104709/files
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
erlend-aaslandhttps://github.com/erlend-aasland
python:mainhttps://github.com/python/cpython/tree/main
indygreg:rework-bolthttps://github.com/indygreg/cpython/tree/rework-bolt
Conversation 19 https://github.com/python/cpython/pull/104709
Commits 4 https://github.com/python/cpython/pull/104709/commits
Checks 0 https://github.com/python/cpython/pull/104709/checks
Files changed https://github.com/python/cpython/pull/104709/files
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
gh-101282: Apply BOLT optimisations to libpython for shared builds https://github.com/python/cpython/pull/104709/files#top
Show all changes 4 commits https://github.com/python/cpython/pull/104709/files
555686d gh-101282: rework the BOLT build process indygreg May 20, 2023 https://github.com/python/cpython/pull/104709/commits/555686d8f761b39f16496e9be36911e1c91e134d
52a266e Fixup doc formatting erlend-aasland May 21, 2023 https://github.com/python/cpython/pull/104709/commits/52a266ebefe29d78e8e434cdb478c10005ad800e
3cf0f36 M4 style nits erlend-aasland May 21, 2023 https://github.com/python/cpython/pull/104709/commits/3cf0f36ef211d38c6bd57c347301b74cabc48244
972dcb2 Remove extra backtick erlend-aasland May 21, 2023 https://github.com/python/cpython/pull/104709/commits/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6
Clear filters https://github.com/python/cpython/pull/104709/files
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
.gitignore https://github.com/python/cpython/pull/104709/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
configure.rst https://github.com/python/cpython/pull/104709/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
Makefile.pre.in https://github.com/python/cpython/pull/104709/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
2023-05-20-16-09-59.gh-issue-101282.FvRARb.rst https://github.com/python/cpython/pull/104709/files#diff-afa310363e824518d7ea1e65bdf2e9f26b78082ff11a77f960c60df502553041
configure https://github.com/python/cpython/pull/104709/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
configure.ac https://github.com/python/cpython/pull/104709/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
.gitignorehttps://github.com/python/cpython/pull/104709/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
View file https://github.com/indygreg/cpython/blob/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6/.gitignore
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/104709/{{ revealButtonHref }}
https://github.com/python/cpython/pull/104709/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
https://github.com/python/cpython/pull/104709/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
https://github.com/python/cpython/pull/104709/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
https://github.com/python/cpython/pull/104709/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L83
Doc/using/configure.rsthttps://github.com/python/cpython/pull/104709/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
View file https://github.com/indygreg/cpython/blob/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6/Doc/using/configure.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/104709/{{ revealButtonHref }}
https://github.com/python/cpython/pull/104709/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
https://github.com/python/cpython/pull/104709/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L84
Makefile.pre.inhttps://github.com/python/cpython/pull/104709/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
View file https://github.com/indygreg/cpython/blob/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6/Makefile.pre.in
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/104709/{{ revealButtonHref }}
https://github.com/python/cpython/pull/104709/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
https://github.com/python/cpython/pull/104709/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
https://github.com/python/cpython/pull/104709/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
https://github.com/python/cpython/pull/104709/files#diff-1f0a8db227d22005511b0d90f5339b97db345917b863954b3b3ccb9ec308767c
Misc/NEWS.d/next/Build/2023-05-20-16-09-59.gh-issue-101282.FvRARb.rsthttps://github.com/python/cpython/pull/104709/files#diff-afa310363e824518d7ea1e65bdf2e9f26b78082ff11a77f960c60df502553041
View file https://github.com/indygreg/cpython/blob/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6/Misc/NEWS.d/next/Build/2023-05-20-16-09-59.gh-issue-101282.FvRARb.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/104709/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L83
configurehttps://github.com/python/cpython/pull/104709/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
View file https://github.com/indygreg/cpython/blob/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6/configure
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L83
configure.achttps://github.com/python/cpython/pull/104709/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
View file https://github.com/indygreg/cpython/blob/972dcb2d2ff30f8c823d8dffc1ed9f1a4669afc6/configure.ac
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/104709/{{ revealButtonHref }}
https://github.com/python/cpython/pull/104709/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
https://github.com/python/cpython/pull/104709/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
https://github.com/python/cpython/pull/104709/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
Please reload this pagehttps://github.com/python/cpython/pull/104709/files
https://github.com/python/cpython/pull/104709/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
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.