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

BartC bc at freeuk.com
Wed Mar 9 07:02:10 EST 2016


On 09/03/2016 08:40, Mark Lawrence wrote:
> On 08/03/2016 23:59, Steven D'Aprano wrote:
>> On Wed, 9 Mar 2016 06:15 am, BartC wrote:
>>
>> [...]
>>> But this was hardly necessary as it was so obvious: it takes 150ms to
>>> process a 300-pixel image, 20 seconds for a 2Mpixel one, and (I have to
>>> switch to PyPy here as I've never had time to hang about for it) 180
>>> seconds for 80Mpixel file.
>>>
>>> Surely the start-up time would be the same no matter what the input.
>>
>>
>> Mark seems to think that it's completely irrelevant, but that's surely
>> wrong.
>>
>
> The exact opposite actually.  I'm trying to make sense of these so
> called benchmark figures, and quite frankly can't make head nor tail of
> them.  BartC also cannot seem to grasp that the vast majority of people
> often couldn't care less about them, but continues banging on as if
> Python will never take off as it's too slow, whereas the reality is that
> it's been doing rather well.

The majority of its users (and not just Python; there are plenty of 
these dynamic languages such as Javascript) probably don't care about it.

They might not appreciate the fact that when they run a script, they are 
most likely executing a library written in a different language by 
people who /do/ care about performance.

There quite a few projects around to get these dynamic languages up to 
to speed, so that there is less reliance on needing to code in languages 
such as C and C++. (If languages such as Python were just as fast in 
executing pure code, who would want to use C++? No one.)

I suspect here that you're just one of those users who don't care what 
goes on behind the scenes.

Now it might be there are so many libraries around already implemented, 
that there is little need for anyone to need to do any pure coding any 
more; you just throw together a script to invoke a library that someone 
else has painstakingly put together in a different language.

That's one point of view.

Here's another: you have a program in Python that you'd quite like to 
port to another dynamic language. Transcribing actual Python code is 
straightforward. Until you come to an import of a module that you can't 
find, because it's not written in Python. Now what? Now, you might 
appreciate the advantage of a program in 100% pure Python.

-- 
Bartc



More information about the Python-list mailing list