[pypy-dev] Slow sqlite user defined functions with pypy.

Elefterios Stamatogiannakis estama at gmail.com
Thu Nov 17 13:02:35 CET 2011


Thanks to all for your answers.

I took some time to think some more about the results and:

For the simple function (which returns 1), CPython roughly takes 1 sec 
and pypy 13 secs. IMHO, this case reveals pypy's callback overhead.

For the complex function case, CPython roughly takes 6 secs and pypy 15 
secs. If we assume that the overhead will be the same as in the simple 
function case, and subtract it, then CPython roughly took 5 secs to 
execute the complex function and pypy 2 secs.

 From the above, i think that my jit guess was wrong (as Alex said), and 
jit indeed works, but the overhead of the pypy callbacks is indeed quite 
large.

I know that callbacks from C code aren't so frequent in Python programs, 
but my project:

http://code.google.com/p/madis/

lives on them. So i would be glad if it could be solved (and madis's 
data processing would become a lot faster).

Alternatively, is there something that i could do in my code that would 
overcome this overhead? Like signalling to the jit engine that this 
function should be always jitted and to do not waste time updating 
statistics (or other tracking information) on it?

thanks

lefteris.

On 17/11/11 10:42, Antonio Cuni wrote:
> On 11/17/2011 02:56 AM, Alex Gaynor wrote:
>
>> The JIT compiles functions without loops too now, so this should be jitted.
>
> ctypes callbacks still go through the old _rawffi, so it's possible that this
> introduces some unneeded overhead.
>
> ciao,
> Anto
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev



More information about the pypy-dev mailing list