Hacker News new | ask | show | jobs
by galacticdessert 2087 days ago
True, but I expect that only ~2% of programs to ever run into this problem
1 comments

Then how come everything is so ridiculously slow these days, despite faster computers?

I've ran into situations when displaying text on the screen was lagging - and that in several different programs, on various (modern) computers. Not saying GC was a problem there, but I guess this has something to do with the generally accepted culture of "only 2% of programs need high performance".

> Then how come everything is so ridiculously slow these days, despite faster computers?

There is difference between GC overhead, VM overhead, interpreter overhead, and programmer not understanding basic concepts and doing stupid shit.

Go is GC language and tools written in Go often approach C/C++ speeds, despite lacking an optimizer like LLVM and lack of some performance oriented features. Another example is OCaml.

> Then how come everything is so ridiculously slow these days, despite faster computers?

As you said, it's usually not a GC issue. Many of these ridiculously slow programs you talk about are written in C++.

VSCode, Slack, Intellij Idea, some random JS on a website - indeed all C++ programs. I'm not arguing against GC, but more about the philosophy of saying that only 2% programs need a good level of performance. It starts from using GC instead of thinking about object ownerships (which btw often also results in harder to read, more convoluted code) and ends up launching an embedded web-browser to display a few images and a bunch of text and taking 1 GB of RAM. But it is not developer's RAM, so who cares?

Summarising - using a GCed language instead of dropping a few occasional clone calls in the code is bad advice, unless the program is really a one-off fire and forget thing (but these are not 98% of software).

The soft I have the most performance issues are Firefox, LibreOffice and Aperçu (don't know its original name, but it's called that way in French -- Apple's PDF viewer). All of them written in different, non-GCed languages. Usuall the problem is abuse of abstraction layers, more than abuse of a GC. And your javascript examples are a good example of that. GCed languages tend to abuse dynamic allocation and dynamic dispatch, even when it's not needed (there is more garbage to deal with).

However I agree the idea only a few software need to run fast is bullcrap.