[Cython] Py_New still good way to create classes?
Stefan Behnel
stefan_ml at behnel.de
Wed Apr 15 20:25:44 CEST 2009
Hi,
thanks for sharing that.
Brent Pedersen wrote:
> assuming i haven't done anything stupid
No, nothing stupid, but something that can reduce the comparability of the
timings. You are creating a 1000000 item list on each benchmark, using a
call to range() in some cases and a list comprehension in others.
It's usually better to move initialisations out of the timings, e.g. by
creating a large range() object once and re-using it. That reduces the
impact of unrelated operations on the absolute numbers.
Stefan
More information about the Cython-dev
mailing list