3 ms·
I've never had to program so efficiently where this kind of thing would matter - only ever optimizing for readability and correctness in terms of bugs. For peo
by aplummer 9y ago
I've never had to program so efficiently where this kind of thing would matter - only ever optimizing for readability and correctness in terms of bugs.
For people who do, do you enjoy performance optimization or does it get tedious?
- sgift 9y agoBit of both. I don't have to do it often and when you really need to press all the performance you can get out of some code it can be really maddening when there is no "obvious" reason. Quite often it is just an accumulation of many very small slowdowns which together are significant and then the measure, change, measure, change, measure ... loop can be very tedious. Sometimes, there are interesting things like changing the whole algorithm to something which performs better or reading up on bit-fiddling tricks which make some code remarkably faster (Hacker's Delight is not for the faint of the heart, but an interesting book nonetheless).
- dm3 9y agoAs time goes on you keep accumulating these details in your head. Then you just think about the low-level stuff the same way you think about the higher-level stuff, like algorithmic complexity, code structure, etc. It does get tedious if you need to get something out of the door fast, but have to shave off another 30% of processing time per unit of work. Honestly, I just try to partition the working set and throw more hardware at the problem in these scenarios.