[issue4715] optimize bytecode for conditional branches

2009-10-16 Thread Ehsan Amiri
Changes by Ehsan Amiri : -- nosy: +esam ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue4715] optimize bytecode for conditional branches

2009-03-01 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Backported as r70071. I also fixed a couple things I missed in the py3k branch in r70076. Thanks all! -- resolution: -> fixed status: open -> closed ___ Python tracker __

[issue4715] optimize bytecode for conditional branches

2009-02-27 Thread Jeffrey Yasskin
Changes by Jeffrey Yasskin : Removed file: http://bugs.python.org/file13182/trunk-opt-cond-jump.patch ___ Python tracker ___ ___ Python-bugs-li

[issue4715] optimize bytecode for conditional branches

2009-02-27 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Collin made some comments at http://codereview.appspot.com/20094. Here's a new patch that fixes them. I plan to commit it over the weekend and then start on issue 2459. Added file: http://bugs.python.org/file13208/trunk-opt-cond-jump.patch ___

[issue4715] optimize bytecode for conditional branches

2009-02-25 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: The numbers are: Intel Core 2, gcc-4.3, 32-bit 2to3: 25.24 -> 24.89: 1.38% faster Django: Min: 0.618 -> 0.607: 1.90% faster Avg: 0.621 -> 0.615: 1.04% faster PyBench: Min: 5324 -> 5280: 0.83% faster Avg: 5456 -> 5386: 1.30% faster Pickle: Min: 1.424 -> 1.37

[issue4715] optimize bytecode for conditional branches

2009-02-25 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Oh, and no problem with picking up the patches. Thanks for writing them in the first place. Here's the backport to trunk. I particularly enjoyed the bit in pyassem.py where I had to teach the pure-Python compiler that you can get to a block without going throu

[issue4715] optimize bytecode for conditional branches

2009-02-24 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Committed as r69961. I'll post the backport to trunk here at least a day before I commit it. -- type: resource usage -> performance versions: +Python 2.7 ___ Python tracker __

[issue4715] optimize bytecode for conditional branches

2009-02-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le mercredi 25 février 2009 à 00:51 +, Jeffrey Yasskin a écrit : > I've updated Antoine's patch to incorporate my comments. This interacts > with issue 2459, but I haven't yet looked at its patch to figure out > how. As a first cut, I'll propose committing t

[issue4715] optimize bytecode for conditional branches

2009-02-24 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: I've updated Antoine's patch to incorporate my comments. This interacts with issue 2459, but I haven't yet looked at its patch to figure out how. As a first cut, I'll propose committing this patch, backporting it to trunk, syncing it into the issue 2459 patch,

[issue4715] optimize bytecode for conditional branches

2009-02-16 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue4715] optimize bytecode for conditional branches

2009-01-14 Thread Paolo 'Blaisorblade' Giarrusso
Changes by Paolo 'Blaisorblade' Giarrusso : -- nosy: +blaisorblade ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue4715] optimize bytecode for conditional branches

2009-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le mercredi 14 janvier 2009 à 02:48 +, Jeffrey Yasskin a écrit : > Looking through the patch... > > I don't really like the names for JUMP_OR_POP and POP_OR_JUMP. I don't like them either, they're the only relatively short ones I could come up with. I'll c

[issue4715] optimize bytecode for conditional branches

2009-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Your change to the "LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP" > optimization doesn't preserve the optimization to: > def f(): > return 1 and a > I suspect we don't care since "0 or a" wasn't optimized. Yes, this optimization seems meant for "while

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: In peephole.c: _optimize isn't a great label name, but I don't have a great replacement. Maybe reoptimize_current_index? Your change to the "LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP" optimization doesn't preserve the optimization to: def f(): retur

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the goal is to replace the opcode peephole optimizer with a more powerful equivalent working on the AST just prior to code generation. -- nosy: +rhettinger ___ Python tracker

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Looking through the patch... I don't really like the names for JUMP_OR_POP and POP_OR_JUMP. (They don't really indicate to me that the choice depends on the truth of the top of the stack.) How about JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (or s/OR/ELSE/)?

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > http://code.google.com/p/spitfire/. It's a template system designed > for performance that I have some experience with. 6% faster on a template system simply by optimizing conditional jumps is quite neat. (the spitfire homepage itself is rather intriguing, th

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sorry, hadn't seen your message before removing the file. Here it is again. Added file: http://bugs.python.org/file12730/condbranches.patch ___ Python tracker _

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12419/condbranches.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Collin Winter
Collin Winter added the comment: On Tue, Jan 13, 2009 at 3:25 PM, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > Hello, > >> I've backported condbranches-plus.patch to trunk, and I'm getting these >> results: > > Thanks! > >> PyBench: 1.84-2.21% faster >> 2to3: 3.83% faster >>

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hello, > I've backported condbranches-plus.patch to trunk, and I'm getting these > results: Thanks! > PyBench: 1.84-2.21% faster > 2to3: 3.83% faster > Spitfire: 6.13-6.23% faster What is Spitfire? > I've haven't tested condbranches.patch vs condbranches-p

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Collin Winter
Collin Winter added the comment: I've backported condbranches-plus.patch to trunk, and I'm getting these results: PyBench: 1.84-2.21% faster 2to3: 3.83% faster Spitfire: 6.13-6.23% faster PyBench was run with -w=1; 2to3 is translating its entire source directory five times; Spitfire is measu

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: pybench runtimes (attached) are almost the same. The big win is on list comprehensions with an "if" clause. Added file: http://bugs.python.org/file12719/pybench.txt ___ Python tracker

[issue4715] optimize bytecode for conditional branches

2009-01-13 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Those look nice, although I need to look at the patches in more detail. What speedup do they give you? -- nosy: +collinwinter, jyasskin ___ Python tracker

[issue4715] optimize bytecode for conditional branches

2008-12-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an optional patch which provides the two opcodes I was talking about (I've called them POP_OR_JUMP and JUMP_OR_POP). Together with a bit of work on the peepholer they make the bytecode expression of boolean calculations very concise. A somewhat contrive

[issue4715] optimize bytecode for conditional branches

2008-12-21 Thread Antoine Pitrou
New submission from Antoine Pitrou : This patch optimizes the bytecode for conditional branches. For example, the list comprehension "[x for x in l if not x]" produced the following bytecode: 1 0 BUILD_LIST 0 3 LOAD_FAST0 (.0) >>