Does CPython already has Peephole optimizations?

2014-02-17 Thread Laxmikant Chitare
Hello All, I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/montanaro.html Just wanted to clarify whether CPython already includes these kind of byte code optimizations? Are all the temporary variables removed when byte code is generated? Regards,

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Peter Otten
Laxmikant Chitare wrote: Hello All, I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/montanaro.html Just wanted to clarify whether CPython already includes these kind of byte code optimizations? Are all the temporary variables removed when

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Steven D'Aprano
On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these kind of byte code optimizations? Are all the temporary

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Ned Batchelder
On 2/17/14 3:59 AM, Steven D'Aprano wrote: On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these kind of byte

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Terry Reedy
On 2/17/2014 3:59 AM, Steven D'Aprano wrote: On Mon, 17 Feb 2014 13:54:25 +0530, Laxmikant Chitare wrote: I read about this article: http://www.python.org/workshops/1998-11/proceedings/papers/montanaro/ montanaro.html Just wanted to clarify whether CPython already includes these kind of

Re: Does CPython already has Peephole optimizations?

2014-02-17 Thread Laxmikant Chitare
Thank you all for the enlightening inputs. I have learnt a lot just with this one question. Great to know about dis library. Ned, from explanation I now realize how important it is to do impact analysis. Things are not always rosy :). I have always appreciated everyone over this list. This is