3 ms·
So so true. Every time I go back to programming microcontrollers in C I'm amazed at how much can be done with just a little code. We waste so much on fluff. But
by zwieback 8y ago
So so true. Every time I go back to programming microcontrollers in C I'm amazed at how much can be done with just a little code. We waste so much on fluff. But then, we do enjoy the fluff.
- zaroth 8y agoFluff in theory should equate to productivity. Sometimes we stop just a bit too soon. I’ve found a great rule of thumb is that once you’re code complete on a module, put in an extra 10% of work with the profiler to try to improve performance. Keep doing 10% spurts until the performance improvement of the last spurt is less than 5x. There’s almost always low hanging fruit which will return at least 10x. Sometimes you find multiple places where you get 10x and your code ends up more than 100x faster. And at that point all your unit tests are written and green so the refactoring is pretty quick. Right? ;-)
- ajuc 8y agoIt helps to have performance targets. Like 60fps, sub-100ms ui reactions, no stuttering, throughput matters or not, timing attacks are a concern or not. It's often the case that optimizing a special case 10 times increases throughput, but makes the user experience worse (because it starts stuttering), makes the code ugly, and allows for timing attacks. So, in many contexts it's actually bad idea. Half the work in optimization is measuring the correct thing.