[Cython] Size of output

Stefan Behnel stefan_ml at behnel.de
Sat Feb 1 04:22:30 EST 2020


Robert Bradshaw schrieb am 01.02.20 um 00:49:
> Taking a quick glance at an auto-generated file for an empty .pyx, we have
> [...]
> ~300 lines module setup code. Even for trivial modules, we still
> declare and call functions for creating globals, preparing types, etc.
> even if we don't have any globals, types, etc.

:)

> I agree there's some fat that could be trimmed there, but not sure
> it'd be worth the effort.

+1

In any non-trivial module where the size really starts to matter, the
portions of unused code that we generate will probably make no difference
at all.

I'll also add that it can sometimes be very difficult to avoid generating
unused code due to target (CPython x.y, PyPy, …) specific utility code that
comes with its own dependencies, which then may or may not be used on a
given target. Removing the final 0.5% of code that is "unused in some
cases" is really not something I would want to invest days into, each time
we make a change in Cython.

Stefan


More information about the cython-devel mailing list