[Cython] Speed up cython for enum declarations
David Cournapeau
cournape at gmail.com
Fri Dec 5 15:01:19 CET 2008
On Fri, Dec 5, 2008 at 7:28 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>
> For lxml, that's been the case for ages. I never timed it, but it takes gcc
> several times longer to compile the generated C code than it takes Cython
> to generate it. To name some numbers, that's about 18000 lines of Cython
> code (counting pyx,pxi,pxd) and some 155000 lines of generated C code.
I am not sure, but I suspect that gcc scales relatively badly with the
size of source files - compilation times, even at -O0 feel
significantly slower above a certain size. For example, when I started
using numpy, a few years ago, I was surprised first that compiling
numpy was slow wrt the amount of code, and I wonder if this due to the
file size (numpy core source files are ~10 000 lines, and include each
other to deal with the lack of a standard way to limit visibility of
symbols). Maybe long names for symbols as typically used in generated
code is harmful, too (again, I know nothing about compiler
technologies, but I suspect strings operations involved in parsing to
be quite demanding if only on the memory allocator).
clang is supposed to be several times faster to compile C - it is
stated as one of the reason for its funding from Apple. It will be
interesting to see how this ends up.
David
More information about the Cython-dev
mailing list