Commit 9c3de43
Backport gh-100345 / Port D39555934: Provide C implementation for asyncio.current_task
Summary:
Implementing it in C makes it about 4x-6x faster
Upstream issue: python/cpython#100344
Upstream PR (3.12): python/cpython#100345
Original summary from D39555934:
Provide a native implementation of current_task as it is called frequently in the RequestContext scope guards.
Test Plan:
CI
```
./python -m test test_asyncio.test_tasks -v -m "*current_task*" -R 3:3
...
----------------------------------------------------------------------
Ran 33 tests in 0.045s
OK (skipped=3)
.
== Tests result: SUCCESS ==
1 test OK.
Total duration: 2.4 sec
Tests result: SUCCESS
```
Reviewers: alexanderm, pranavtbhat, #cinder
Reviewed By: alexanderm
Differential Revision: https://phabricator.intern.facebook.com/D42229719
Tasks: T132307964
Tags: commitClose, cinder-310-upstream-complete, accept2ship, cinder-310-standalone-upstream-candidate1 parent 0bd735a commit 9c3de43
4 files changed
Lines changed: 93 additions & 8 deletions
File tree
- Lib
- asyncio
- test/test_asyncio
- Modules
- clinic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
| 974 | + | |
974 | 975 | | |
975 | 976 | | |
976 | 977 | | |
977 | 978 | | |
978 | 979 | | |
979 | 980 | | |
| 981 | + | |
980 | 982 | | |
981 | 983 | | |
982 | 984 | | |
| |||
989 | 991 | | |
990 | 992 | | |
991 | 993 | | |
| 994 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2972 | 2972 | | |
2973 | 2973 | | |
2974 | 2974 | | |
| 2975 | + | |
2975 | 2976 | | |
2976 | 2977 | | |
2977 | 2978 | | |
| |||
2982 | 2983 | | |
2983 | 2984 | | |
2984 | 2985 | | |
2985 | | - | |
| 2986 | + | |
2986 | 2987 | | |
2987 | 2988 | | |
2988 | 2989 | | |
2989 | | - | |
| 2990 | + | |
2990 | 2991 | | |
2991 | 2992 | | |
2992 | 2993 | | |
2993 | | - | |
| 2994 | + | |
2994 | 2995 | | |
2995 | | - | |
2996 | | - | |
| 2996 | + | |
| 2997 | + | |
2997 | 2998 | | |
2998 | 2999 | | |
2999 | 3000 | | |
3000 | | - | |
| 3001 | + | |
3001 | 3002 | | |
3002 | 3003 | | |
3003 | 3004 | | |
| 3005 | + | |
3004 | 3006 | | |
3005 | 3007 | | |
3006 | 3008 | | |
3007 | 3009 | | |
3008 | 3010 | | |
3009 | | - | |
| 3011 | + | |
| 3012 | + | |
3010 | 3013 | | |
3011 | 3014 | | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
3012 | 3019 | | |
3013 | 3020 | | |
3014 | 3021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8344 | 8344 | | |
8345 | 8345 | | |
8346 | 8346 | | |
| 8347 | + | |
| 8348 | + | |
| 8349 | + | |
| 8350 | + | |
| 8351 | + | |
| 8352 | + | |
| 8353 | + | |
| 8354 | + | |
| 8355 | + | |
| 8356 | + | |
| 8357 | + | |
| 8358 | + | |
| 8359 | + | |
| 8360 | + | |
| 8361 | + | |
| 8362 | + | |
| 8363 | + | |
| 8364 | + | |
| 8365 | + | |
| 8366 | + | |
| 8367 | + | |
| 8368 | + | |
| 8369 | + | |
| 8370 | + | |
| 8371 | + | |
| 8372 | + | |
| 8373 | + | |
| 8374 | + | |
| 8375 | + | |
| 8376 | + | |
| 8377 | + | |
| 8378 | + | |
| 8379 | + | |
| 8380 | + | |
| 8381 | + | |
| 8382 | + | |
| 8383 | + | |
8347 | 8384 | | |
8348 | 8385 | | |
8349 | 8386 | | |
| |||
8534 | 8571 | | |
8535 | 8572 | | |
8536 | 8573 | | |
| 8574 | + | |
8537 | 8575 | | |
8538 | 8576 | | |
8539 | 8577 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments