6 ms·
"Computers are very fast" Better to know how much time things take.
by osigurdson 3y ago
"Computers are very fast"
Better to know how much time things take.
- crabmusket 3y agoI did this for the first time recently and it was a super satisfying experience. I'm mostly a web dev, but I was experimenting with some very mathy Rust code. I did some back of the envelope calculations about how many cycles a CPU might take on various floating point operations, multiplied that by the number of items I was pumping through it, and arrived at a number that was 4x out... then realised the Rust compiler had performed auto-vectorisation with SSE2! I wasn't spot-on, but I was within like 20-30% I think. And that made me feel like a real engineer haha.
- DavidPiper 3y agoWhile I agree with you in isolation, the context for that line is: > but it’s important to figure out what is truly necessary storage-wise versus what can be derived on-the-fly. In the “v1” of something, I’ve found that minimizing as much mutable state as possible gets you pretty far. It seems like the author is specifically calling out that you shouldn't store derived data unless you either can't recreate it easily or have measured (usually a post-v1 activity) that it is faster to store/cache that derived data.
- osigurdson 3y agoI think the author is always creating a certain type of application where db -> web server -> web page latency and throughput don't cause any performance problems. My main point is, don't assume that all applications are the same. Know when you are in new territory and the old heuristics don't apply. I'm triggered by context free "I usually find that..." and "In my experience..." assertions.