René's URL Explorer Experiment


Title: Tail calling interpreter for MSVC · Issue #139922 · python/cpython · GitHub

Open Graph Title: Tail calling interpreter for MSVC · Issue #139922 · python/cpython

X Title: Tail calling interpreter for MSVC · Issue #139922 · python/cpython

Description: Feature or enhancement Proposal: We should get tail calling interpreter support for MSVC. The latest up-to-date figures for the tail calling interpreter are: 1-3% pyperformance faster on Ubuntu x64 4-5% pyperformance faster on macOS AArc...

Open Graph Description: Feature or enhancement Proposal: We should get tail calling interpreter support for MSVC. The latest up-to-date figures for the tail calling interpreter are: 1-3% pyperformance faster on Ubuntu x64...

X Description: Feature or enhancement Proposal: We should get tail calling interpreter support for MSVC. The latest up-to-date figures for the tail calling interpreter are: 1-3% pyperformance faster on Ubuntu x64...

Opengraph URL: https://github.com/python/cpython/issues/139922

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tail calling interpreter for MSVC","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nWe should get tail calling interpreter support for MSVC.\nThe latest up-to-date figures for the tail calling interpreter are:\n* 1-3% pyperformance faster on Ubuntu x64\n* 4-5% pyperformance faster on macOS AArch64\n* The last benchmarks for the tail calling interpreter on Windows MSVC reported a [17% speedup on pyperformance](https://github.com/mdboom/msvc-tailcall-analysis).\n\nOn Windows, the performance isn't easy to measure because `pyperf system tune` doesn't work on there. However, on a best-effort quiet system and some benchmarks from pyperformance on my system, these are my results:\n\n```\nMean +- std dev: [spectralnorm_tc_no] 146 ms +- 1 ms -\u003e [spectralnorm_tc] 98.3 ms +- 1.1 ms: 1.48x faster\nMean +- std dev: [nbody_tc_no] 145 ms +- 2 ms -\u003e [nbody_tc] 107 ms +- 2 ms: 1.35x faster\nMean +- std dev: [bm_django_template_tc_no] 26.9 ms +- 0.5 ms -\u003e [bm_django_template_tc] 22.8 ms +- 0.4 ms: 1.18x faster\nMean +- std dev: [xdsl_tc_no] 64.2 ms +- 1.6 ms -\u003e [xdsl_tc] 56.1 ms +- 1.5 ms: 1.14x faster\n```\nNote that I had to apply a 2-line patch to fix xDSL for Python 3.15.\n\nNbody and spectralnorm are toy shootout benchmarks. xDSL is a [new benchmark](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_xdsl/run_benchmark.py) added that is a MLIR DSL library with written almost entirely in pure Python. I consider it a pure-Python large library not too far off from mypy (though it's obviously smaller). 14% faster for xDSL is massive. It's roughly half of the [speedup we got in 3.11 with the specializing interpreter](https://github.com/EdmundGoodman/masters-project-report/tree/0f55308d74e9634de79ea32582bad0212693508d), and that was thousands of lines of code. This change in contrast will be just one PR. [Django templating](https://github.com/python/pyperformance/tree/main/pyperformance/data-files/benchmarks/bm_django_template) shows a big speedup too -- 18% faster.\n\nThis could not have been possible without help from the MSVC team. Specifically, I'd like to give a shoutout to Hulon Jenkins and the MSVC team in the patch notes when I land this.\n\nI've discussed this during the Wednesday CHIPS meetings, and there was no opposition to the new set of changes required to get this working. The changes are minimal and mostly just involve adding correct `restrict` and scoping to things to tell MSVC a local variable doesn't escape. This should also benefit GCC and Clang in some fashion.\n\nWe require working CI before this is merged, so I am now waiting on GitHub actions or some other CI to get this working.\n\nVery special shoutout as well to @chris-eibl who has been helping me with this on Windows.\n\nSome other benefits: the TC on MSVC actually correctly \"resets\" the inlining heuristic on MSVC. This means eventually we can get rid of all the macros and ugly hacks we have to make the current interpreter faster on MSVC once we distribute the builds with tail calling. Example of a hack where we use macros over static inlines on MSVC just because of the interpreter loop breaking the inliniing heuristics of MSVC https://github.com/python/cpython/issues/121263\n\n#### Possibility of a compiler bug this time\n\nI doubt it, as MSVC has no computed goto, so it can't have the same bug as Clang that we bumped into the previous time.\n\n#### Where are the perf gains coming from?\n\nIt's mainly the better inlining that we get from the tail calling interpreter, and elimination of double jumps vs the switch-case interpreter.\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-139962\n* gh-143068\n* gh-143087\n* gh-143242\n* gh-146391\n* gh-146570\n* gh-148035\n* gh-148036\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Fidget-Spinner","@type":"Person","name":"Fidget-Spinner"},"datePublished":"2025-10-10T19:36:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/139922/cpython/issues/139922"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4d261ef6-8dec-cd17-b48f-0770eeb83763
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC77A:1E3EC6:669DB8:8C6128:6A514F96
html-safe-nonce4ed1e2e1704a7ebe60f4d5249a6c2a5e6d0c99f07cfa5a1d17bbf3ce581e6394
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzdBOjFFM0VDNjo2NjlEQjg6OEM2MTI4OjZBNTE0Rjk2IiwidmlzaXRvcl9pZCI6IjU4MjQzNDc5NTU4MDk4MzI4NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac98b95906a47decacac0b75fdc463dbb68ce7c27c6cf0aa016372e5ae7fa36764
hovercard-subject-tagissue:3504282874
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/139922/issue_layout
twitter:imagehttps://opengraph.githubassets.com/16556345bb003c67cb78b84d3a0fcecaaa74a80139d4f8846633c2371130f7ce/python/cpython/issues/139922
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/16556345bb003c67cb78b84d3a0fcecaaa74a80139d4f8846633c2371130f7ce/python/cpython/issues/139922
og:image:altFeature or enhancement Proposal: We should get tail calling interpreter support for MSVC. The latest up-to-date figures for the tail calling interpreter are: 1-3% pyperformance faster on Ubuntu x64...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFidget-Spinner
hostnamegithub.com
expected-hostnamegithub.com
None6f17634ed2af1d116850bcea6c63a70a4d72970f33ade1dd3eef3764b7e16994
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
release511bff6ea06e144ed085ff736aea4c6404987b00
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/139922#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F139922
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2Fissues%2F139922
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/139922
Reloadhttps://github.com/python/cpython/issues/139922
Reloadhttps://github.com/python/cpython/issues/139922
Please reload this pagehttps://github.com/python/cpython/issues/139922
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/139922
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
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 and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Tail calling interpreter for MSVChttps://github.com/python/cpython/issues/139922#top
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/Fidget-Spinner
Fidget-Spinnerhttps://github.com/Fidget-Spinner
on Oct 10, 2025https://github.com/python/cpython/issues/139922#issue-3504282874
17% speedup on pyperformancehttps://github.com/mdboom/msvc-tailcall-analysis
new benchmarkhttps://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_xdsl/run_benchmark.py
speedup we got in 3.11 with the specializing interpreterhttps://github.com/EdmundGoodman/masters-project-report/tree/0f55308d74e9634de79ea32582bad0212693508d
Django templatinghttps://github.com/python/pyperformance/tree/main/pyperformance/data-files/benchmarks/bm_django_template
@chris-eiblhttps://github.com/chris-eibl
#121263https://github.com/python/cpython/issues/121263
gh-139922: Tail calling for MSVC (VS 2026) #139962https://github.com/python/cpython/pull/139962
GH-139922: Tail calling for MSVC (VS 2026) #143068https://github.com/python/cpython/pull/143068
gh-139922: Add tail call for MSVC for whats new in 3.15 #143087https://github.com/python/cpython/pull/143087
gh-139922: Link to results in MSVC tail calling 3.15 #143242https://github.com/python/cpython/pull/143242
GH-139922: update 3.15 whatsnew: Windows 64-bit binaries now use the tail-calling interpreter #146391https://github.com/python/cpython/pull/146391
gh-139922: always run MSVC 64-bit tail-calling CI #146570https://github.com/python/cpython/pull/146570
GH-139922: add interpreter types to InternalDocs/interpreter.md #148035https://github.com/python/cpython/pull/148035
GH-148047: Check early whether tail-calling is possible for MSVC builds on Windows #148036https://github.com/python/cpython/pull/148036
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
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.