jffhn
Joined 7 years ago
Joined 7 years ago
Non-tautological rephrasing: When optimizing code, first actually just de-slowify it, and that should most often be plenty enough.
- The CPU is infinitely fast.
- RAM is infinite.
- CPU caches don't exist.
- Cache lines don't exist.
The main reason I saw around me for memory leaks in GC'ed languages, is devs only thinking about the 'add' part, not the 'when-to-remove' part. I always think of both and the only leaks I got were from slowdowns causing events to pile up in scheduler queues (deliberately not bounded).
Of course they do. A program's code is mostly a graph of names; they can be cornerstones of its clarity, or sources of confusion and bugs.
The first thing I do when debugging is ensuring proper names, sometimes that's enough to make the bug obvious.
That can be seen as a feature: cos(angRad) will never return zero, avoiding edge cases, and same with sin(angRad) if argument is not zero.