3 ms·
This [1] is a bytecode optimizer for Python - it takes the bytecode from CPython's compiler, and outputs bytecode with a few select optimizations. Anyone know
by andrewf 8y ago
This [1] is a bytecode optimizer for Python - it takes the bytecode from CPython's compiler, and outputs bytecode with a few select optimizations.
Anyone know of someone taking this idea further?
[1] http://code.activestate.com/recipes/277940-decorator-for-bindingconstants-at-compile-time/ http://code.activestate.com/recipes/277940-decorator-for-bin... - it's old, for Python2.4
- joejev 8y agoI work on a library for doing Python bytecode transformations like this, but with a more abstract API. Here is a similar transformation with this library, which works with Python 3: https://github.com/llllllllll/codetransformer/blob/master/codetransformer/transformers/constants.py https://github.com/llllllllll/codetransformer/blob/master/co...