[pypy-issue] Issue #2069: pypy(version 2.6) can not recognize and jit the cffi function without lib.xxxfunction calling way (pypy/pypy)
liuzhenhai
issues-reply at bitbucket.org
Mon Jun 22 16:26:28 CEST 2015
New issue 2069: pypy(version 2.6) can not recognize and jit the cffi function without lib.xxxfunction calling way
https://bitbucket.org/pypy/pypy/issue/2069/pypy-version-26-can-not-recognize-and-jit
liuzhenhai:
it seems that pypy(version 2.6) can not recognize and jit the cffi function without lib.xxxfunction calling way. Here is the code.
```
#!python
from cffi import FFI
ffi=FFI()
ffi.cdef('''
int add(int a, int b);
''')
ffi.set_source('_my_test','''
int add(int a, int b){
return a+b;
}
''')
ffi.compile()
from _my_test import ffi,lib
%timeit lib.add(1,2)
add=lib.add
%timeit add(1,2) # slower than lib.add(1,2) about 6x
```
Responsible: arigo
More information about the pypy-issue
mailing list