[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Joe Jevnik
Joe Jevnik added the comment: I tried bumping the magic number; however, I still cannot get consistent results when running benchmark locally. I guess I will close this as I cannot consistently show an improvement. -- status: open -> closed ___ Pyth

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Yury Selivanov
Yury Selivanov added the comment: > Does the benchmark tool recompile the code every run? Make sure you've bumped magic number in importlib/bootstrap; then make clean; make -- ___ Python tracker _

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Joe Jevnik
Joe Jevnik added the comment: I am actually getting inconsistent results from running benchmark; I am pretty surprised by this. I could look into making the second pass only happen if the code has the CO_OPTIMIZED bit set; however, based on the results I am seeing from the benchmark runs, I am

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Brett Cannon
Brett Cannon added the comment: Just FYI, http://bugs.python.org/issue11549 can act as a tracking issue for an AST optimization path that runs prior to the peepholer. -- nosy: +brett.cannon ___ Python tracker

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Christian Heimes
Christian Heimes added the comment: How about restricting double pass optimization to code objects that have the CO_OPTIMIZED bit set? It doesn't affect normal code execution. -- nosy: +christian.heimes ___ Python tracker

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would like to keep the time spent in the optimizer itself to a minimum. Also, it should keep focused on patterns that actually occur in code as opposed to contrived bits of code. Tim and Guido let us put it the optimizer only on the condition that it b

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Yury Selivanov
Yury Selivanov added the comment: Is there any noticeable performance increase with the patch? Please attach results from https://hg.python.org/benchmarks -- nosy: +yselivanov ___ Python tracker __

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Eric Snow
Eric Snow added the comment: > Also, Python/importlib.h blew up in the diff; should this be included in the patch? Yes. It is the frozen bytecode for bootstrapping importlib as the import system. So changes to bytecode generation like this will propagate there. -- nosy: +eric.snow __

[issue24014] Second pass of PyCode_Optimize

2015-04-20 Thread Joe Jevnik
New submission from Joe Jevnik: There are a lot of optimizations that are being missed by only running a single pass of PyCode_Optimize. I originally started by trying to optimize for De Morgan's Laws in if tests; however, I realized that the issue actually went away if you run the optimizer t