[pypy-dev] JITability

Maciej Fijalkowski fijall at gmail.com
Mon Jan 30 18:47:57 CET 2012

On Mon, Jan 30, 2012 at 7:40 PM, Davide Setti <davide.setti at gmail.com> wrote:
> On Mon, Jan 30, 2012 at 5:05 PM, Maciej Fijalkowski <fijall at gmail.com>
> wrote:
>> I think it does not matter, and for
>> more than one reason in this particular case (on of those being that
>> even though bool objects are boxed, there are only two of them - True
>> and False)
> Probably this is another question: what about using 1 and 0 instead of True
> and False?\

Not any different in this case.

> In (your) jitviewer i see that the "infinite while loops" 'while 1' is
> better than 'while True'. Am i right? Is it faster in the validatePhone case
> too? Is it possible to remove this (very small) overhead with the JIT?
> Thanks
> --
> Davide Setti
> code: http://github.com/vad

The actual loop for while 1: and while True: is not different, only
the preamble differs. It's generally faster in the interpreted mode
because you don't have to check if the global True is not rebinded.

while True:
   if some_condition:
      True = False

More information about the pypy-dev mailing list