Amaury Forgeot d Arc <[email protected]> added the comment:

There is some unnecessary slowness when a function returns a function pointer.

In the ffi.cdef() declarations I modified deq() to return a void*,
then I added a cast in the calling code:
    fp = q.deq()
    fp = ffi.cast("FuncPtr", fp)
    fp()
this makes the "cpp" version much faster, 3x faster than the pure python 
version.

----------
assignedto:  -> arigo
nosy: +amaury, arigo

________________________________________
PyPy bug tracker <[email protected]>
<https://bugs.pypy.org/issue1529>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to