New submission from Dennis Sweeney <sweeney.dennis...@gmail.com>:
list_resize is a long function that probably won't get inlined. But for the vast majority of cases in list.append, we just need to check whether the list is big enough (not whether it's small enough, or whether it's null or the wrong type), then insert and update the size. This can be inlined, with an actual call only taking place whenever we need to resize. We can also add a reference-consuming version of PyList_Append to elide an INCREF/DECREF pair. ---------- components: Interpreter Core messages: 415116 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Streamline list.append for the common case type: performance versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue47009> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com