this post was submitted on 21 Nov 2023
4 points (100.0% liked)
Performance
360 readers
3 users here now
A community for posts relating to performance
Wormhole
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I always see the same thing everywhere: human intuition is terrible for optimisation, always measure, etc. If I'm honest my experience is closer to the opposite.
When a program is slow the path to fixing it usually involves fixing multiple things in very specific ways, often in totally different places. Only after fixing all of them does the blockage disappear, and suddenly everything is lightning fast. That's really hard to figure out by looking at profiler output. I can only do it by having a mental model of how the program works and inuition about what I would expect to be slow. Following the profiler might get me there after days or weeks of trial & error, or I can just poke around the code and have a think about it.
The profiler is still an important tool, especially for verifying theories and improvements, but in my experience the most important thing is inuition. Just thinking about the ratios of different inputs, the operations performed, the memory layout, the caching and branching behaviour, etc.
The article is not a bad guide, but this one thing always bugs me.