[Cython] Cython syntax to pre-allocate lists for performance

Nikita Nemkin nikita at nemkin.ru
Thu Mar 7 13:02:17 CET 2013


Sorry, accidental early send. Previous mail continued...

[None] * N makes an extra pass over the list to assign None to each item
(and also incref None n times).
This is useless extra work. The larget the list, the worse it gets.


Best regards,
Nikita Nemkin


More information about the cython-devel mailing list