Pyhon 2.x or 3.x, which is faster?

Ben Finney ben+python at benfinney.id.au
Mon Mar 7 21:28:17 EST 2016


BartC <bc at freeuk.com> writes:

> On 08/03/2016 01:40, Chris Angelico wrote:
> > You need to be VERY clear about exactly what you're measuring. Are
> > you using the 'timeit' module to measure execution of one line of
> > code? Are you putting your code into a file and running that with
> > /usr/bin/time? Are you putting the code into Idle and running it in
> > a loop with 'exec' and using time.time() around the outside? Your
> > numbers do not concern me *because they mean nothing*.
>
> So they're just random numbers?

That's not an implication from what Chris is saying. Rather, the
implication is the numbers do not have the meaning you're ascribing to
them.

> I write interpreters. If I suddenly saw a 115% increase in runtime
> from one version to another, /even on a trivial 2-line loop/ (or even
> on /any/ program doing the same task), then I'd want to know why!
> Because experience tells me that something is wrong.

Sure. Experience is not, though, going to tell you *what* is wrong until
you can be much more specific in your observations, and verifiably
attribute observations to behaviour.

Until then, with all the experience in the world, to claim you know the
explanation is merely unfounded assertion.

-- 
 \             “Skepticism is the highest duty and blind faith the one |
  `\               unpardonable sin.” —Thomas Henry Huxley, _Essays on |
_o__)                                   Controversial Questions_, 1889 |
Ben Finney




More information about the Python-list mailing list