1 Jun 2011 16:26
Re: [Cython] Bindings performance issue
2011/6/1 mark florisson <markflorisson88@...>: > On 31 May 2011 20:25, Vitja Makarov <vitja.makarov@...> wrote: >> Hi! >> >> Is bindings performance issue valuable? >> >> $ cat bindbench.pyx >> def wo_bindings(): >> pass >> >> def outer(): >> def inner(): >> pass >> return inner >> with_bindings = outer() >> >> $ python >>>>> import timeit >>>>> timeit.repeat('with_bindings()', setup='from bindbench import wo_bindings, with_bindings', repeat=1, number=100000000) >> [6.169871807098389] >>>>> timeit.repeat('wo_bindings()', setup='from bindbench import wo_bindings, with_bindings', repeat=1, number=100000000) >> [4.609416961669922] >> >> PyCBindings makes it 1.3 (difference is about 15ns on my laptop) times >> slower for CPython interpreter execution. >> As CPython has some optimizations for CFunctions and PyCFunctions. >> >> Does it make sense for us? Or we can easily switch to bindings?(Continue reading)
RSS Feed