classification
Title: Use a linked list for the ceval pending calls.
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.8
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: eric.snow Nosy List: emilyemorehouse, eric.snow, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-12-11 22:10 by eric.snow, last changed 2019-03-02 00:03 by eric.snow. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11122 closed eric.snow, 2018-12-11 22:15
Messages (4)
msg331655 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2018-12-11 22:10
Currently the list of pending calls (see Include/internal/pycore_ceval.h) is implemented as a circular buffer.  A linked list would be easier to understand and modify.  It also allows for removing the restriction on the number of pending calls.
msg331662 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-11 22:49
Was not a circular array used intentionally because this allows to avoid calling malloc()?

And the proposed code looks more complicated to me than the current code.
msg331663 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2018-12-11 23:02
I suppose performance could have been a motivator originally.  However, I don't see a benefit now that signals handlers are no longer pending calls.  If it's a real problem then we can leverage a free list.

As to complexity, the motivator for this change was difficulty I had (along with another core dev) in quickly understanding the logic for manipulating the circular buffer.  I find the linked list much easier to understand.
msg336974 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2019-03-02 00:03
At this point I'm not terribly interested in this. :)
History
Date User Action Args
2019-03-02 00:03:46eric.snowsetstatus: open -> closed
resolution: wont fix
messages: + msg336974

stage: patch review -> resolved
2018-12-11 23:02:30eric.snowsetnosy: + emilyemorehouse
messages: + msg331663
2018-12-11 22:49:40serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg331662
2018-12-11 22:15:38eric.snowsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request10354
2018-12-11 22:10:27eric.snowcreate