Live data from Hacker News

Python is Slow, and I Don't Care

medium.com

51–60 of 69 posts

Re: Python is Slow, and I Don't Care

#51

Earlier quoted context omitted.

Python 3's long road to full adoption is much more about mishandling major breaking changes than it is about lack of performance optimizations.

If Python3 was 5x as fast i can tell you right now that people would be scrambling head over heels to migrate. Instead they are migrating because they no longer have support for their libraries, or because someone said they were a bad person for not keeping up with the latest cool thing.

I sincerely doubt that. PyPy is advertised as being about 7x as fast ad CPython and yet it also has incredibly low adoption rates because of potential breakage and incompatibilities.

Re: Python is Slow, and I Don't Care

#52

From my comment on the blog article: Allow me to point out some important points of disagreement here. “Speed no longer matters” While computers are faster, the expectations of users are also higher. New monitors today have 14,745,600 pixels and that is still growing fast, that is 7 times more than 1920x1080 which was the norm just a couple of years ago. That means for any app involving UI or graphics, you have signi…

> Exactly the same language can exist in JITted form, and does, and it should be brought up to be the default and only way of executing python Yes, PyPy, Jypthon, etc. exist and they can be faster. If you want to use those, then great, do it! But a JIT is not faster in all cases, only some cases. Python is first and foremost a scripting languages, and for a lot of the simple script cases, CPython is faster than a JIT…

Being first and foremost a scripting language doesn't mean anything.

If the argument is that for really short programs the iteration time when building and running is faster with the interpreter, because you don't have to build, I can't see how this matters. It would be a sub microsecond difference for short scripts. If it isn't, make a better JIT. (or even better, native compile it, as all things should be in my fever dreams)

Re: Python is Slow, and I Don't Care

#53

Earlier quoted context omitted.

> almost all of YouTube was written in Python and has or is still being rewritten in C++, Java, and Go, saving XX millions of dollars per year of CPU time. If you reach YouTube scale, maybe the CPU savings > developer time. But I don't think you will reach that scale if you start with C++. Completion will outpace you in no time.

There are middle grounds between c++ and interpreted Python that have the same productivity as python and better performance.

Absolutely, but in the end it all depends what problem you are trying to solve, and which stage you are on.

If you are starting a new startup, with Python or Ruby or PHP you may be able to try 2-3x ideas in the same time. Which means 2-3x more chances of succeeding.

If you are adding a new service to an existing businesses, it may worth the time investing in some middle-ground.

If you are google or facebook, I guess rewriting everything makes sense from financial point of view.

Re: Python is Slow, and I Don't Care

#54
post #7

"A company’s most expensive resource is now its employee’s time. Or in other words, you. It’s more important to get stuff done then to make it go fast." Now take this sentence and apply it to the end user of your software.

Maybe I'm daft, but I don't quite understand what your getting at.

https://public.wsu.edu/~brians/errors/your.html

Re: Python is Slow, and I Don't Care

#55
post #21
post #2

You should care. PHP7 cared about speed and it was a success. Python 3 cared pretty much everything else except for speed and now 10 years had passed it didn't go anywhere.

Isn't Python3's primary issue that it killed developer productivity?

How would it do that?

Re: Python is Slow, and I Don't Care

#56
I've read this exact article at least a dozen times over the last 25 years (replace Python with some other language).

More interesting than the actual content is the question why this topic is of such perennial interest, is it a feeling of inferiority of programmers working in higher-level but slower languages? Or frustration with coworkers wasting time on premature optimization? Probably a mixture of both.

Re: Python is Slow, and I Don't Care

#57

A counterexample is Celery when used for things such as network IO. You can't scale horizontally because each process creates a database connection, and you'd need a giant database server just to handle a bunch of network IO. The Celery code would probably have to get its parameters from a cache or somewhere that's not the database, but this breaks their suggested use case of accessing the database models when the ta…

I guess you could use a connection pooler like pgpool-2?

Re: Python is Slow, and I Don't Care

#58
post #28

Earlier quoted context omitted.

> then later rewritten in C++ or Go, and generally ran with 100x fewer resources This kind of story comes again all the time, but the most important detail is always missing: how much of that 100x can be attributed to the language, and how much can be attributed to now I know the domain better, I know where the pitfalls are, how to model the problem, and when I need to optimize ? Because arguably the second one can b…

It's about half and half, 50x comes from the language and 50x comes from experience. The important part is to add those factors together by good management.

The math here doesn't really make sense, factors multiply, so if there were two 50x factors the total improvement would be 2500x. In other words if one factor is 50x, the other one must be 2x to get 100x total.

Re: Python is Slow, and I Don't Care

#59

Earlier quoted context omitted.

Correct. Like writting in python, but optimizing the "bottlenecks" in C/C++/Cython

Why not just compile/JIT the python, always? I feel like I'm taking crazy pills! :) Even when you write the hot bits in C++ you still have a python interpreter thrashing the CPU caches and using up ram. and now you have to context switch in your head more often, and the build process is more complex, and usually there is a cost when you do the FFI.

If you are talking about PyPy (I presume you are?), then two issues are that it can in some cases be slower, and also C libraries such as Numpy / SciPy are not simple to use with PyPy (I think some of Numpy has been translated, but there are many useful C libraries for Python).

Re: Python is Slow, and I Don't Care

#60

Earlier quoted context omitted.

It's about half and half, 50x comes from the language and 50x comes from experience. The important part is to add those factors together by good management.

The math here doesn't really make sense, factors multiply, so if there were two 50x factors the total improvement would be 2500x. In other words if one factor is 50x, the other one must be 2x to get 100x total.

[deleted]
Post reply on HN