Title: bpo-32204: Optimize asyncio.Future _schedule_callbacks by LiraNuna · Pull Request #4186 · python/cpython · GitHub
Open Graph Title: bpo-32204: Optimize asyncio.Future _schedule_callbacks by LiraNuna · Pull Request #4186 · python/cpython
X Title: bpo-32204: Optimize asyncio.Future _schedule_callbacks by LiraNuna · Pull Request #4186 · python/cpython
Description: Summary While migrating our code to asyncio, we've noticed that performance was not up to our standards. We have been performing profiles to determine what are some quick wins we could contribute to python in order to increase asyncio's performance. While investigating, we have noticed that the method set_result of asyncio.Future is very slow when a lot of callbacks are waiting for the future. When digging, we noticed that a full copy of all callbacks is made. This PR corrects this issue and reduces the amount of time set_result takes on our benchmarks from 17% down to 2.5% Test plan In addition to passing all unit tests, I performed a before and after profiles using cProfile: Before: After: https://bugs.python.org/issue32204
Open Graph Description: Summary While migrating our code to asyncio, we've noticed that performance was not up to our standards. We have been performing profiles to determine what are some quick wins we could contribu...
X Description: Summary While migrating our code to asyncio, we've noticed that performance was not up to our standards. We have been performing profiles to determine what are some quick wins we could cont...
Opengraph URL: https://github.com/python/cpython/pull/4186
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4f69fe8d-ce5a-fa5e-9130-68218c752c7a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C774:E8423:117C9FA:177D8C3:696AD207 |
| html-safe-nonce | 5aab8bbf64be82ac45dfc02d75013d2dee31b7bc3252a0ba564f17205c1073a8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzc0OkU4NDIzOjExN0M5RkE6MTc3RDhDMzo2OTZBRDIwNyIsInZpc2l0b3JfaWQiOiI1ODM5NTc3MjI2OTI2NTQzMzY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4808f8dfe3b2c50e80d038ef9fd24e42041715d322732e9490d82ac458b43806 |
| hovercard-subject-tag | pull_request:149720486 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/4186/files |
| twitter:image | https://avatars.githubusercontent.com/u/205628?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/205628?s=400&v=4 |
| og:image:alt | Summary While migrating our code to asyncio, we've noticed that performance was not up to our standards. We have been performing profiles to determine what are some quick wins we could contribu... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width