logoalt Hacker News

PaulRobinsonlast Tuesday at 9:39 PM2 repliesview on HN

Can you actually give an example?

I believe in mechanical empathy. I think developers should - win performance is a concern - think about how their code ends up on the CPU, what ends up on the heap, how caches are used, and so on.

But for most Python developers, and Ruby developers, it's more important, in more use cases, to have clear and readable code that is easily maintainable.

I've met Sandi, I've gone through her Ruby books, I recommend her teaching and her books to others. I don't see the problem.

If you need ASM, use ASM. If you're on a team doing OOP, maybe learn about OOP.


Replies

henninglast Tuesday at 9:58 PM

Look at the fastest linting/build tools/runtimes for JavaScript. They are mostly not written in JavaScript, because JavaScript is slow and no amount of hotspot profiling/optimization will fix that. This is also why Python's core data types for dictionaries and so on are not implemented in Python.

You can also look at any microbenchmark between pure Python and a native language of your choice, even one that uses GC like OCaml or Go, and unless the Python code has been written so that it spends all its time calling C code the way you sometimes can with regex-heavy code, Python will generally lose by a varying margin. These micro inefficiencies multiply at every level hundreds of times over to create needlessly slow, inefficient applications.

The truth is I can link benchmarks, case studies of app rewrites from Ruby to Go or something comparable, measurements about the results of using NIFs in Erlang/Elixir, etc. all day long but you'll ignore all of them.

show 1 reply