[Python-Dev] astoptimizer: static optimizer working on the AST

Stefan Behnel stefan_ml at behnel.de
Wed Mar 27 21:23:36 CET 2013


Victor Stinner, 26.03.2013 22:56:
>  * what should be the name of "pyc" files?
>  * how to handle different configuration of astoptimizer: generate
> different "pyc" files?

You could use (a part of) a crypto hash of the serialised options as part
of the filename. One drawback of a .pyc duplication is that when you ship
code to other environments that run with different optimiser flags, those
would not pick up the same .pyc files. Although, would it really be a
problem if different modules that were compiled with different optimisation
settings get mixed on the same machine? Are there any non semantics
preserving AST modifications for a module that have an impact on other
modules? I.e., is this just a development time concern when trying out
different optimisations, or is this a problem for deployed code as well?

Stefan




More information about the Python-Dev mailing list