Skip to main content
8 events
when toggle format what by license comment
Dec 23, 2015 at 22:39 comment added user8709 @Brandon - in fairness, (1) what compilers optimize well now they may not have optimized well years ago, (2) the manual optimization that worked well with old machines and compilers may be counterproductive now. Basically, when some pattern keeps recurring, you're not going to measure the same pair of things every single time - that's obvious redundant work for development-time optimization - but unless performance is a major everyday focus for you, you probably won't notice when things change so those old lessons no longer apply.
Dec 23, 2015 at 19:12 comment added Brandon I second @Steve314. I am the performance lead on a product and often find massively over-complicated code whose origin I can trace back to some sort of performance optimization. Simplifying that code often reveals a significant performance improvement. One such example turned into a 5x performance improvement when I simplified it (net reduction of thousands of lines of code). Clearly, nobody took the time to actually measure and simply did premature optimization of what they thought would probably be slow code.
Jan 19, 2013 at 18:32 vote accept user997112
Dec 21, 2012 at 4:02 comment added user8709 On "premature optimization" - that still applies even if the optimized code will be just as "nice" as the unoptimized code. The point is to not waste time aiming for speed/whatever that you don't need to achieve. In fact optimization isn't always about speed, and arguably there's such a thing as unnecessary optimization for "beauty". Your code doesn't need to be a great works of art in order to be readable and maintainable.
Dec 20, 2012 at 3:23 comment added Erik Reppen I think putting some though into basic work avoidance as you go is worthwhile as long as it doesn't come at expense of legibility. Keeping things concise, legible and doing only doing the obvious things they need to do leads to a lot of indirect long-term perf wins like other developers knowing what the heck to make of your code so they don't duplicate effort or make bad assumptions about how it works.
Dec 19, 2012 at 1:43 comment added Martijn Verburg I'll add "Measure, don't guess"
Dec 18, 2012 at 21:34 comment added Carson63000 "Make it work, then make it fast". This answer pretty much covers everything I thought to say as I read the question.
Dec 18, 2012 at 21:28 history answered Robert Harvey CC BY-SA 3.0