[Python-Dev] Python 3 optimizations, continued, continued again...

Stefan Behnel stefan_ml at behnel.de
Wed Feb 1 08:45:35 CET 2012


stefan brunthaler, 31.01.2012 22:17:
>> Well, nobody wants to review generated code.
>>
> I agree. The code generator basically uses templates that contain the
> information and a dump of the C-structure of several types to traverse
> and see which one of them implements which functions. There is really
> no magic there, the most "complex" thing is to get the inline-cache
> miss checks for function calls right. But I tried to make the
> generated code look pretty, so that working with it is not too much of
> a hassle. The code generator itself is a little bit more complicated,
> so I am not sure it would help a lot...

How many times did you regenerate this code until you got it right? And how
do you know that you really got it so right that it was the last time ever
that you needed your generator for it? What if the C structure of any of
those "several types" ever changes?

Stefan



More information about the Python-Dev mailing list