4
top 1 comments
sorted by: hot top controversial new old
[-] porgamrer@programming.dev 1 points 7 months ago* (last edited 7 months ago)

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.

this post was submitted on 21 Nov 2023
4 points (100.0% liked)

Performance

286 readers
1 users here now

A community for posts relating to performance

Wormhole

!programming@programming.dev

founded 11 months ago
MODERATORS