Timeline for Is micro-optimisation important when coding?
Current License: CC BY-SA 3.0
73 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 6, 2020 at 18:42 | review | Suggested edits | |||
| Feb 7, 2020 at 13:33 | |||||
| Feb 6, 2020 at 18:41 | comment | added | T. Sar | Your father is a retired programmer that most probably worked on retired tech. It was just a few years ago that we barely had 16mb of RAM to work with. | |
| Nov 20, 2019 at 21:07 | comment | added | Pedro Amaral Couto | I don't understand some comments appealing to readability here. I think it's silly to say that "if (counter < X || expensiveFunction())" is not readable or maintainable. If it's more efficient and it's readable and maintainable, then, most probably, it's better. Merely quoting Donald Knuth is not a valid argument, especially if the quotations are out of context. He lamented developers avoiding optimizations for the sake of it. If the retired father is wrong, then Knuth was also wrong in 1974. | |
| Nov 20, 2019 at 20:51 | comment | added | Pedro Amaral Couto | Donald Knuth: "The conventional wisdom shared by many of today's software engineers calls for ignoring efficiency in the small; but I believe this is simply an overreaction to the abuses they see being practiced by penny-wise-and-pound-foolish programmers, who can't debug or maintain their "optimized" programs." (Structured Programming with go to Statements, 1974) | |
| Feb 6, 2019 at 19:12 | comment | added | Patrick Hughes | One rarely mentioned, harmful side effect of optimizing at a low level too soon is that once that code is in place it freezes the upper level designs. At that point if you have to refactor due to other pressures on the project all that work at the lowest levels is wasted. This may be perfectly OK in Waterfall projects in well known technologies where the design cannot change, but not in more modern and flexible projects. | |
| Dec 21, 2018 at 2:55 | answer | added | user321630 | timeline score: 1 | |
| Oct 13, 2017 at 13:33 | comment | added | Mark Booth | In what way @JakubKania (though perhaps we should take this to Software Engineering Chat). | |
| Oct 12, 2017 at 22:19 | comment | added | Jakub Kania | @MarkBooth Also if the expensive() is false often enough expensive() && cheap() may perform better with short-circuit evaluation. | |
| May 23, 2017 at 12:40 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Apr 12, 2017 at 7:31 | history | edited | CommunityBot | replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/ | |
| Nov 17, 2015 at 21:17 | answer | added | David Rissato Cruz | timeline score: 0 | |
| Aug 14, 2015 at 9:52 | comment | added | gnat | see also: Should you sacrifice code readability with how efficient code is? | |
| May 15, 2015 at 10:46 | history | edited | 7ochem | Added performance tag | |
| Jul 2, 2014 at 14:17 | review | Close votes | |||
| Jul 5, 2014 at 21:33 | |||||
| Jul 2, 2014 at 14:02 | comment | added | nawfal | possible duplicate of Is premature optimization really the root of all evil? | |
| Apr 4, 2014 at 21:34 | history | protected | CommunityBot | ||
| Apr 4, 2014 at 19:23 | history | edited | Peter Mortensen | CC BY-SA 3.0 | Copy edited. Removed historical information. |
| Apr 17, 2013 at 9:44 | comment | added | MarkJ | @TomWijsman Great quote. And the quote was made in 1974, so even a retired programmer like the OP's father should have come across it in his career :) | |
| Apr 17, 2013 at 9:32 | history | edited | gnat | CC BY-SA 3.0 | SO spelled per http://meta.stackoverflow.com/a/40354/165773 |
| Apr 17, 2013 at 7:25 | answer | added | nawfal | timeline score: 1 | |
| Aug 10, 2012 at 12:53 | comment | added | webvitaly | I updated the code samples. Should be "||" (or) instead of && (and) because with && there in no difference between those two lines of code (they works the same). | |
| Aug 10, 2012 at 12:49 | history | edited | webvitaly | CC BY-SA 3.0 | should be || (or) instead of && (and) because with && there in no difference between those two lines of code (they works the same) |
| Jul 30, 2012 at 18:46 | history | edited | Jim | CC BY-SA 3.0 | reference link |
| Jul 30, 2012 at 18:05 | answer | added | webvitaly | timeline score: 1 | |
| Jun 20, 2012 at 8:00 | answer | added | Mark Hurd | timeline score: 0 | |
| Aug 11, 2011 at 10:30 | comment | added | Mark Booth | Note that cheap() && expensive() is not an optimisation of expensive () && cheap() in a language with short-circuit evaluation unless you can guarantee that both expensive() and cheap() are side effect free. | |
| Aug 10, 2011 at 17:45 | answer | added | user11408 | timeline score: 0 | |
| Aug 10, 2011 at 17:05 | history | edited | Boz | CC BY-SA 3.0 | added 224 characters in body |
| Aug 10, 2011 at 16:25 | answer | added | Zan Lynx | timeline score: 7 | |
| Aug 10, 2011 at 12:21 | history | edited | Boz | CC BY-SA 3.0 | Added a summary |
| Aug 10, 2011 at 10:33 | history | unlocked | ChrisF | ||
| Aug 10, 2011 at 9:31 | vote | accept | Boz | ||
| Aug 9, 2011 at 19:57 | history | locked | ChrisF | ||
| Aug 9, 2011 at 16:27 | answer | added | KeithS | timeline score: 4 | |
| Aug 9, 2011 at 12:33 | comment | added | BlueRaja - Danny Pflughoeft | @woliveirajr: That is the definition of micro-optimizing | |
| Aug 9, 2011 at 12:09 | comment | added | woliveirajr | coder does not consider performance in their code even at the micro level, they are not good programmers is very different from micro-optimizing. It's just good coding. | |
| Aug 9, 2011 at 12:08 | answer | added | woliveirajr | timeline score: 1 | |
| Aug 9, 2011 at 7:47 | comment | added | Boz | @Michael Easter my father told me - not sure where he got it from, will ask him | |
| Aug 9, 2011 at 2:42 | comment | added | sarat | Jeff Atwood's article is worth a read - codinghorror.com/blog/2004/08/… | |
| Aug 9, 2011 at 1:05 | answer | added | janm | timeline score: 5 | |
| Aug 9, 2011 at 0:59 | comment | added | FumbleFingers | @Michael Easter: It depends how you define "the internet". The data centres use maybe 2%, but that's not counting the actual pc's and stuff. And it's all going up very fast, so 10% probably isn't ridiculous soon, if not quite yet. | |
| Aug 8, 2011 at 23:12 | comment | added | Michael Easter | Can you provide a source on "10% of the world's energy" ? | |
| Aug 8, 2011 at 22:55 | answer | added | Mike Cellini | timeline score: 8 | |
| Aug 8, 2011 at 22:41 | answer | added | ansiart | timeline score: 3 | |
| Aug 8, 2011 at 21:45 | answer | added | zwol | timeline score: 7 | |
| Aug 8, 2011 at 20:27 | comment | added | apacay | KISS Principle 4 the win! | |
| Aug 8, 2011 at 20:17 | comment | added | Tamara Wijsman | I'm sad because the famous Premature Optimization quote hasn't been mentioned yet: "Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%." | |
| Aug 8, 2011 at 19:57 | answer | added | phkahler | timeline score: 30 | |
| Aug 8, 2011 at 19:53 | answer | added | zidarsk8 | timeline score: 18 | |
| Aug 8, 2011 at 19:46 | answer | added | SingleNegationElimination | timeline score: 7 | |
| Aug 8, 2011 at 18:40 | history | tweeted | twitter.com/#!/StackProgrammer/status/100637400769892352 | ||
| Aug 8, 2011 at 18:26 | comment | added | JeffO | If the key word is consider, he is not wrong. You have to have some clue about it. | |
| Aug 8, 2011 at 18:18 | comment | added | warren | how interesting - InfoWorld had an article on this just last week | |
| Aug 8, 2011 at 17:39 | comment | added | Loki Astari | You father's advice is outdated. I would not ask how much it improves performance. I would ask where the bottleneck is. It does not matter if you improve the performance of a section of code if it makes no overall difference, your slowest link is going to determine the speed. In PHP this is writing to the network (unless you can prove IE measure otherwise); which translates into writing more readable code is more important. | |
| S Aug 8, 2011 at 17:39 | answer | added | back2dos | timeline score: 87 | |
| S Aug 8, 2011 at 17:39 | history | made wiki | Post Made Community Wiki by back2dos | ||
| Aug 8, 2011 at 17:37 | comment | added | BlueRaja - Danny Pflughoeft | Your dad is absolutely wrong, but in his defense: 20+ years ago, the tools (editor, compiler, debugger, profiler) were nowhere near as powerful as they are now, while memory and computing time were significantly more constrained and expensive. What he said was true back then, but the opposite is true today. | |
| Aug 8, 2011 at 17:33 | answer | added | treecoder | timeline score: 25 | |
| Aug 8, 2011 at 17:27 | answer | added | user1249 | timeline score: 4 | |
| Aug 8, 2011 at 17:25 | answer | added | HLGEM | timeline score: 4 | |
| Aug 8, 2011 at 17:14 | answer | added | Mike Dunlavey | timeline score: 103 | |
| Aug 8, 2011 at 17:13 | answer | added | thorsten müller | timeline score: 4 | |
| Aug 8, 2011 at 17:10 | answer | added | DeadMG | timeline score: 3 | |
| Aug 8, 2011 at 17:09 | answer | added | Mark Booth | timeline score: 113 | |
| Aug 8, 2011 at 17:05 | answer | added | Caleb | timeline score: 7 | |
| Aug 8, 2011 at 17:03 | answer | added | P.Brian.Mackey | timeline score: 11 | |
| Aug 8, 2011 at 16:58 | answer | added | deadalnix | timeline score: 8 | |
| Aug 8, 2011 at 16:58 | answer | added | user3792 | timeline score: 5 | |
| Aug 8, 2011 at 16:58 | answer | added | Thomas Owens♦ | timeline score: 127 | |
| Aug 8, 2011 at 16:55 | answer | added | JB King | timeline score: 3 | |
| Aug 8, 2011 at 16:47 | answer | added | Daniel Moura | timeline score: 4 | |
| Aug 8, 2011 at 16:47 | answer | added | rjzii | timeline score: 6 | |
| Aug 8, 2011 at 16:33 | history | asked | Boz | CC BY-SA 3.0 |