[Cython] Speed up cython for enum declarations
Stefan Behnel
stefan_ml at behnel.de
Wed Dec 3 11:04:34 CET 2008
Robert Bradshaw wrote:
> Actually, the parsing takes up a significant amount of the compile time.
Which reminds me: I hope the OP uses an installed (i.e. compiled) version
of Cython. That should be a lot faster than running it from a working
directory.
Another thing that comes to mind: in case the OP restarts Cython for each
module, that would definitely slow down the compilation for a larger set
of modules. I think the current build_ext extension doesn't reuse parser
contexts either.
>> Would it be easy to get a notion of 'precompiled' pxd files otherwise
>
> Yes and no. This is something I've tried to do before, and still want
> to do.
I remember a discussion about pickling parsed .pxd files. I think that
would still make sense.
> One difficulty is handling dependancies between pxd files, for
> example if a typedef or cdef class changes in one, then everything
> that cimports and uses it changes.
Cython already keeps track of module dependencies (a Pyrex feature). But
I'm not sure if that extends to inter-pxd dependencies. It should be easy
to support that, though. Then the dependency list would tell you if you
have to re-parse a pickled .pxd.
Stefan
More information about the Cython-dev
mailing list