Live data from Hacker News

Python is Slow, and I Don't Care

medium.com

31–40 of 69 posts

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

#31
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 significantly more work to do. This same trend applies to processing data, as databases are also bigger, complexity and amount of features expected has also increased. To keep up with that you can’t throw away cycles.

While computers are faster, many more people are doing computing on small devices like phones and tablets where battery power is a precious resource, and slow code wastes battery life faster.

The cost of scaling server side infrastructure can seem cheap with a naive analysis, but high performance code can not only mean fewer servers or cloud services to buy, but also a simpler architecture. As soon as you have to scale beyond 1 web server for instance, you now also need to worry about load balancing, and a host of other issues. High performing code can keep you on a single server for an amazingly huge workload.

Lower latency has been proven to make money https://blog.gigaspaces.com/amazon-found-every-100ms-of-late...

Another point of disagreement is the idea that this performance his we take with interpreted Python is completely unnecessary. 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. There also exist plenty of similarly nice and expressive languages that perform better (OCaml, F#, etc)

Every day I am annoyed by slow software, and until that stops I will never accept the argument that performance doesn’t matter.

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

#33

I see a lot of concern online about Python's performance, but at the same time I don't see a lot of people talking about things like Iron Python or Jython. Is there a reason these solutions aren't adopted more?

Probably in part because of the attitude that performance doesn't matter.

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

#34
post #28
post #11

If your reasoning is productivity above everything, therefore the only solution you can think of is Python, I call BS. As a Googler, I could relate countless stories of systems that were cobbled together in Python and then scaled up with massive investment, then later rewritten in C++ or Go, and generally ran with 100x fewer resources. Hell, from what I can tell, almost all of YouTube was written in Python and has or…

> 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…

In my own deep experiments with simplex noise generation in c++ and C#, C++ allowed me to go ~10x faster and it was 100% due to the 'language' (and associated ecosystem).

Domain knowledge for me is higher in C#, both were optimized as far as I could figure out.

There are dozens of cpu instructions you can't even make happen in most runtime GC languages. It is banananastown.

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

#35
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.

That's a very weird argument. I pretty much exclusively use Python 3, so to me it seems hugely successful, where as I didn't even know that PHP7 existed.

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

#36
post #11

If your reasoning is productivity above everything, therefore the only solution you can think of is Python, I call BS. As a Googler, I could relate countless stories of systems that were cobbled together in Python and then scaled up with massive investment, then later rewritten in C++ or Go, and generally ran with 100x fewer resources. Hell, from what I can tell, almost all of YouTube was written in Python and has or…

> 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.

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

#37

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 version. It doesnt make sense to make that the default.

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

#38

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.

There is a significant amount of people stuck on 2.7 due to platform restrictions; quite a few OSes still under support are using 2.7 as their system Python and there's no incentive to upgrade these systems.

Even if Python 3 was 10x as fast, sysadmins would hesitate to put what's effectively an unsupported version of Python on their systems.

Massive performance increases would help to sway those who have the freedom to move to a different Python without being locked to their system, I agree about that much.

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

#39
post #11

If your reasoning is productivity above everything, therefore the only solution you can think of is Python, I call BS. As a Googler, I could relate countless stories of systems that were cobbled together in Python and then scaled up with massive investment, then later rewritten in C++ or Go, and generally ran with 100x fewer resources. Hell, from what I can tell, almost all of YouTube was written in Python and has or…

But if those system were developed in another language, maybe by the time they were released there would not be any market demand for it anymore. I've seen it happen where everything is meticulously performance optimized in C and by the time it is released it is fast, snappy, scalable but by then the market has moved on and nobody wants to use it anymore.

Often "We moved from X to Y because X is slow" is seen as a failure of X, but it is not. It could mean the feature was deployed quickly, caught on and has customers which want to use it. So it can be a testament of how productive X is.

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

#40
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.

[deleted]
Post reply on HN