Skip to content

gh-136669: build _asyncio as static module - #136670

Merged
kumaraditya303 merged 8 commits into
python:mainfrom
kumaraditya303:asyncio-perf
Jul 16, 2025
Merged

gh-136669: build _asyncio as static module#136670
kumaraditya303 merged 8 commits into
python:mainfrom
kumaraditya303:asyncio-perf

Conversation

@kumaraditya303

@kumaraditya303kumaraditya303 commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

@AA-TurnerAA-Turner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to keep _asyncio in Setup.stdlib.in, it isn't really in the same category as boostrap.in. You could instead add the *static* directive in a new section at the end of the file, see e.g. the current *shared* directive on line 187. Would this work?

A

@kumaraditya303

Copy link
Copy Markdown
ContributorAuthor

I think it would be better to keep _asyncio in Setup.stdlib.in, it isn't really in the same category as boostrap.in. You could instead add the static directive in a new section at the end of the file, see e.g. the current shared directive on line 187. Would this work?

Yes, that worked, I have changed it now. Thanks

@kumaraditya303
kumaraditya303 marked this pull request as ready for review July 15, 2025 16:38
@kumaraditya303kumaraditya303 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 15, 2025
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit 87ff8fc 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136670%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 15, 2025
Comment threadModules/_remote_debugging_module.c
@kumaraditya303

Copy link
Copy Markdown
ContributorAuthor

Looks like there is some network issue on ubuntu bots.

@kumaraditya303

Copy link
Copy Markdown
ContributorAuthor

The CI is fixed now and tested locally on macOS:

sudo ./python.exe -m test test_external_inspection -v== CPython 3.15.0a0 (heads/asyncio-perf:424b6568065, Jul 16 2025, 16:43:27) [Clang 17.0.0 (clang-1700.0.13.5)]== macOS-15.5-arm64-arm-64bit-Mach-O little-endian== Python build: debug== cwd: /Users/kumaraditya/work/cpython/build/test_python_worker_92525æ== CPU count: 10== encodings: locale=UTF-8 FS=utf-8== resources: all test resources are disabled, use -u option to unskip testsUsing random seed: 15797115460:00:00 load avg: 8.90 Run 1 test sequentially in a single process0:00:00 load avg: 8.90 [1/1] test_external_inspectiontest_async_gather_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_gather_remote_stack_trace) ... oktest_async_global_awaited_by (test.test_external_inspection.TestGetStackTrace.test_async_global_awaited_by) ... oktest_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) ... oktest_async_staggered_race_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_staggered_race_remote_stack_trace) ... oktest_asyncgen_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_asyncgen_remote_stack_trace) ... oktest_only_active_thread (test.test_external_inspection.TestGetStackTrace.test_only_active_thread) ... oktest_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace) ... oktest_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace) ... oktest_unsupported_platform_error (test.test_external_inspection.TestUnsupportedPlatformHandling.test_unsupported_platform_error) ... skipped 'Test only runs on unsupported platforms (not Linux, macOS, or Windows)'----------------------------------------------------------------------Ran 9 tests in 0.546sOK (skipped=1)0:00:00 load avg: 8.90 [1/1] test_external_inspection passed== Tests result: SUCCESS ==1 test OK.Total duration: 594 msTotal tests: run=9 skipped=1Total test files: run=1/1Result: SUCCESS

@kumaraditya303kumaraditya303 linked an issue Jul 16, 2025 that may be closed by this pull request
@kumaraditya303
kumaraditya303 merged commit b7d7225 into python:mainJul 16, 2025
92 of 113 checks passed
@kumaraditya303
kumaraditya303 deleted the asyncio-perf branch July 16, 2025 16:39
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
`_asyncio` is now built as a static module so that thread states can be accessed directly via registers and avoids the overhead of function call.
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
`_asyncio` is now built as a static module so that thread states can be accessed directly via registers and avoids the overhead of function call.
facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull request Sep 29, 2025
Summary: backport of [gh-136669: build _asyncio as static module](python/cpython#136670) (upstream issue: [gh-136669](python/cpython#136669), as done in upstream for 3.15
Reviewed By: fried
Differential Revision: D83414959
fbshipit-source-id: df542f1fdeeaaae9e836b723f8048b3499857d2a
jjhelmus added a commit to jjhelmus/python-build-standalone that referenced this pull request Apr 7, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build _asyncio module as static module

4 participants

@kumaraditya303@bedevere-bot@AA-Turner@pablogsal