<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 5:29 PM Armin Rigo <<a href="mailto:arigo@tunes.org">arigo@tunes.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Brett,<br>
<br>
On 6 March 2015 at 19:11, Brett Cannon <<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>> wrote:<br>
> I disagree with your premise that .pyo files don't have a noticeable effect<br>
> on performance. If you don't use asserts a lot then there is no effect, but<br>
> if you use them heavily or have them perform expensive calculations then<br>
> there is an impact.<br>
<br>
Maybe you'd be interested to learn that PyPy (at least the 2.x branch)<br>
uses a new bytecode, JUMP_IF_NOT_DEBUG, to conditionally jump over the<br>
"assert" line. In "optimized" mode PyPy follows the jumps; in<br>
"non-optimized" mode it doesn't. This mode is initialized with the -O<br>
flag but can be changed dynamically, as the bytecode is the same. We<br>
introduced it as a simple solution to the mess of .pyc versus .pyo.<br>
(We didn't consider the case of -OO very closely because PyPy is much<br>
bigger than CPython as a binary to start with, so the demand for that<br>
is lower.)<br></blockquote><div><br></div><div>Interesting, so you simply merged the optimization levels 0 and 1 in the bytecode and basically drop .pyo files thanks to it. That might be some motivation to support the default file name not having any specified optimization level at all. </div></div></div>