gh-110693: Use a Linked List for Pending Calls#110694
gh-110693: Use a Linked List for Pending Calls#110694ericsnowcurrently wants to merge 26 commits intopython:mainfrom
Conversation
|
🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit bc284be 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Could you find a different reviewer instead of me? Maybe @colesbury? I have not looked at any of this stuff in ages -- feels like decades. |
|
This seems like it will make calls beyond the 32 quite expensive, as each request will require an allocation and a deallocation, beyond the existing cost. Is having a fixed size list a problem in practice, or is it just that 32 items is too few? If you are going to go with a linked list, I'd suggest dropping the array and only using a linked list, to simplify the code. Maybe add a hard limit of a few thousand for safety? |
24774ab to
814cb0c
Compare
too few
Good point. It just isn't clear what is a safe number. The problem is that if you've hit the max then currently
Agreed. The only catch is that the signal machinery uses pending calls as a fallback in certain cases. Starting off the freelist with a handful of preallocated items helps avoid problems. That said, I've done it a slightly different way that I think is less intrusive.
You mean drop the current limit ( |
We do the following:
struct _pending_callsto use a linked list_PyRuntime.ceval.main_pending)(This is a variation of gh-11122.)