Hacker News new | ask | show | jobs
by starmole 1568 days ago
First: I love the collection of knowledge. Any project doing that is worth doing.

On the other hand: How do you teach performance engineering? I learned it in the Demoscene, which was simply a competition. "I can do this effect in 2 cycles less". Not everybody will be a good performance engineer. Or should be! I feel like the people who do good in performance engineering will be competitive and find their win in whatever environment. Maybe that is a good context for the book: That's what people did to win!

3 comments

I think in order to teach performance engineering, the person being taught has to actually care about performance. I don’t think a lot of software folks really deeply care about performance too much.
Significantly increasing performance is one of the most rewarding tasks in software development, comparable only to deleting unused code. At least for me.

However, for most business applications, it doesn’t bring much value. Modern hardware allows a lot of inneficiencies, and having some step few seconds faster or slower won’t matter much. In the last decade I spent maybe a day per year improving performance.

However, when I worked on some mini games recently performance was important since day 1. And I got a lot of joy from that process, programming was fun again!

Caring about whole-system performance is another step beyond that, because you mainly care about second-order effects and not going full blast using all the resources.

Even the performance people can argue with me on here when I give them correct advice like that you might not want to try and use all CPU and memory just because they're there.

(For instance because your process is lower priority and so is only scheduled on E-cores and so the # CPUs number you see doesn't actually apply to you.)

I think a lot of it comes down to language. Summer languages (e.g. python, Matlab, R), performance engineering is a constant fight against an interpreter that is painful. other languages (e.g. C) make it tedious to write fast code because you lack higher level features.
D is the closest thing to a "I write generic code which is then optimal for all the situations I can think of" language that I have found so far.

Writing a type that automatically becomes SOA vs. AOS is relatively easy in D, almost impossible in C i.e. please stop writing "fast" code in C.

> Writing a type that automatically becomes SOA vs. AOS is relatively easy in D

There's a library (which I haven't tried out) for doing this in C++20: https://github.com/celtera/ahsohtoa

(The author is an HN regular, jcelerier.)

D is nice. I find Nim even nicer (the static introspection is more complete, and syntactic chatter/noise is lower). https://nim-lang.org/

Several people have done the entity component system (ECS) thing.

"Summer languages"?
You need to know so much about everything that I don't think there's any point in trying to teach it in a structured manner.

People who are going to be good at it are the kind of people who work that kind of stuff out themselves.