As Python2 is finally being put to bed I thought it was time I moved to Python3 but when I did so I found the same code...

As Python2 is finally being put to bed I thought it was time I moved to Python3 but when I did so I found the same code is running between 20 and 40% slower in Python3 than it was in Python2.

What gives? I've searched around a bit but haven't found anything that sounds like a plausible explanation and most places are saying that Python3 is faster than Python2 now.

Attached: pythonperf.png (861x562, 34K)

python is deprecated
use node js

kys

Yep that’s right python 3 is still slower than 2.

python is deprecated
use gnu octave

don't use python at all if you're worried about execution time

python is great OP, easy to use and with all the features you need.
But I don't know about the performances difference between the two

Attached: cd58380374ca918b61eb858919561bb2.jpg (528x720, 71K)

It compiles to some kind of binary code the first time you run it. Maybe you just had your python2 code pre-compiled.

why?
its faster, has a better syntax
and just like python a lot of libraries

happens if you don't use Perl like a sane person

Na, every time I test it I get similar results. I've done it several times now.

happens if you don't use OCaml like a sane person

That being said, have you ruled out start time? It's one of the things that have gotten constantly worse...

>That being said, have you ruled out start time?
Yeah, it's most definitely not just start time.

Python3 has always been slower than Python2 in my experience and the experience of everyone I've talked to about it. I'm surprised you're seeing the opposite opinion online.

Either way, Python is slow. If you're doing things that need to be performant, use a different language (or at least get it working with pypy)

It's not that I am after high performance. I just want to understand why it is this much slower and how I could actually justify going to Python3.
I may not be worried about performance, but I also don't want my shit to be taking 40% longer to run for no reason.

>how I could actually justify going to Python3
It's supported and has slightly better syntax and semantics.
>I also don't want my shit to be taking 40% longer to run for no reason
Then you shouldn't be using python. CPython as an interpreter is written to be simple and easy to expand, not fast. It will waste time all over the place that other interpreters/compilers never would, and 3 only slightly more so than 2

Just use Julia. simple syntax like Python, Python interop, but infinitely faster

If only it was 0 indexed.

>muh python3
to me the only difference was "print" not being a keyword anymore

i thought speed was one of those things you'd just expect to not have when using python
is the difference really that noticeable?

Well those numbers are in seconds, so we are talking 75 seconds vs ~110 seconds in that particular script, which isn't even using large amounts of data yet.

>javascript
>good syntax

Besides that, when we're talking about other programming languages, python probably has one of the best syntaxes overall. Also it is currently the best option for a script language, if you need one for any reason.

> making excuses for python's garbage performance
> takes 40% longer to execute
> oh you shouldn't be using python then
fuck off, moron. you're a joke.
node.js is pure cancer written for web retards. it's bloated, inefficient, plus node & its "libraries" are a security nightmare. but it's great to see the usual retards trying to defend this indefensible cancer. i think it's amusing and oh so adorable.

bunch of unicode shit maybe?

if you want a fast programming language then use lua

run it through cProfile

you gotta be trolling
programming with non-blocking calls is a major pain for most uses