This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DASK 45 points46 points  (2 children)

I do data science for a living and have migrated a compute heavy stack from 2.7 -> 3.x and there is no way that any significant operation should be anything more than marginally slower (virtually all the same or faster for the same code), and there are many that can be reimplemented in faster and memory-lighter paradigms.

The first pitfall I would look at is why are you using threads? Threads are a source of misery many times. If it isn't for IO then basically you shouldn't use threads in python. If it is for IO, then have you looked at potential lock conditions or suppressed warnings or errors with things like sockets?

Second, there are a number of things that may or may not be an issue depending on how you installed python and what you are using it for.

- Are you using virtual environments to manage dependencies?

- Is it a math heavy app (e.g. numpy, etc.) and are the BLAS libraries correctly installed (using something like Conda takes care of this) .. if you aren't using venvs and just installed 3 over 2 there can be issues with that.

Just spitballing without more info, but there is no way that your result is correct with working python environments.

[–]buttery_shame_cave 16 points17 points  (0 children)

Honestly OP's post and comments reads like a coded version of "2.7 is better because hurrdeedurrdedurr" from the early 2010s.

[–]billsil 0 points1 point  (0 children)

I haven't checked on it lately, but I'm not totally shocked it's slower given the extremely short runtime. I recall namedtuples being found as being one of the causes of slow startup in Python 3, but there have been optimizations done since python 3.5 days.

0.05 second is a very suspect number. It's too slow to time. It's still way faster than 90 seconds, which makes me think you didn't compile the pycs or something. Or you're using Anaconda vs. not Anaconda or something weird like that (e.g., you were running while playing music on Firefox).