[Cython] New early-binding concept [was: CEP1000]

Stefan Behnel stefan_ml at behnel.de
Thu Apr 19 13:51:16 CEST 2012


Vitja Makarov, 19.04.2012 10:35:
> I've tried to implement trivial approach for CyFunction. Trivial means
> that function accepts PyObjects as arguments and returns an PyObject,
> so trivial signature is only one integer: 1 + len(args). If signature
> match occurs dirct C-function is called and PyObject_Call() is used
> otherwise. I didn't succeed because of argument cloning problems, we
> discussed before.
> 
> About dict lookups: it's possible to speedup dict lookup by a constant
> key if we have access to dict's internal implementation. I've
> implemented it for module-level lookups here:
> 
> https://github.com/vitek/cython/commit/1d134fe54a74e6fc6d39d09973db499680b2a8d9

My gut feeling tells me that this optimisation is seriously pushing it.

Stefan


More information about the cython-devel mailing list