You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2022-04-06.03:19:51.278>created_at=<Date2022-03-14.04:57:38.385>labels= ['interpreter-core', '3.11', 'performance']
title='Streamline list.append for the common case'updated_at=<Date2022-04-06.03:19:51.277>user='https://github.com/sweeneyde'
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.