faster-cpython / ideas

1.67k stars 49 forks source link

BUILD_LIST should work similarly to BUILD_TUPLE #503

Closed lpereira closed 1 year ago

lpereira commented 1 year ago

BUILD_LIST creates a new, empty list with a certain capacity, and them pops each element from the stack, adding them in backwards-order to the list. BUILD_TUPLE essentially does an open-coded memcpy() from the stack.

lpereira commented 1 year ago

Browser submitted before I was done investigating this.