News for hackers. Stuff that matters.
Re:“Clean” Code, Horrible Performance by chpatrick on Tuesday February 28, 2023 @04:22PM (#34975027)
Often it's because of bad (quadratic) algorithms, not because the code isn't micro-optimized. For example: https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times...
Re:“Clean” Code, Horrible Performance by morelisp on Tuesday February 28, 2023 @04:40PM (#34975242)
Accidentally super-linear algorithms happen a lot more when you hide stuff behind three layers of interfaces rather than seeing "oh, this uses a list instead of a set".
Re:“Clean” Code, Horrible Performance by jstimpfle on Tuesday February 28, 2023 @04:48PM (#34975333)
True story. And after taking a couple jobs optimizing some messy software modules I've learned to not take those jobs anymore. The only solution is to throw the crap out of the window and to start afresh with a clean understanding of what we want to achieve. A simple and straightforward solution without BS abstractions is not only much faster but also much less bug-ridden.
Re:“Clean” Code, Horrible Performance by AnIdiotOnTheNet on Tuesday February 28, 2023 @04:31PM (#34975133)
It isn't about "micro-optimization", that's just what bad developers use as an excuse for never caring at all about performance. Casey uses the term "depessimization" to describe the process of making a program not run like shit.

Modern computers are ludicrously fast, and modern developers have somehow managed to make them slow.

Regardless, these programs should be spending 99% of their time waiting for user input, but instead they're working data through a mountain of abstraction layers on the faulty assumption that it is a) saving developers' time, and 2) that that is worth much more than user time.

Re:“Clean” Code, Horrible Performance by loup-vaillant on Tuesday February 28, 2023 @06:20PM (#34976369)
https://www.lesswrong.com/tag/scope-insensitivity

Emotionally we have no idea how bad it is to waste as little as a few seconds per day for millions of users. It's just a few seconds, right? We're just forgetting to multiply those seconds by the number of users.