[Cython] Speed up cython for enum declarations

Robert Bradshaw robertwb at math.washington.edu
Thu Dec 4 03:16:54 CET 2008


On Dec 3, 2008, at 3:11 PM, Greg Ewing wrote:

> Stefan Behnel wrote:
>
>> 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.
>
> The difficulty as I see it would be figuring out how to
> pickle just the declarations that came from a particular
> .pxd file. Simply pickling the symbol table as it's
> currently implemented would end up pickling far too much,
> and unpickling it would create duplicates of objects
> that you don't want duplicated.

Yes, these are *exactly* the kind of issues that I've been looking  
at, and it's not simple. Things were interconnected enough that it  
felt like I was pickling the entire state of the compiler. Extracting  
just the new declarations (and then making sure when they're  
unpickled that uniqueness and consistency is preserved) is a messy task.

Pickling the (unprocessed) parse tree is not as optimal, but has  
shown some hope.

- Robert



More information about the Cython-dev mailing list