Link: the fallacy of premature optimization
http://www.acm.org/ubiquity/views/v7i24_fallacy.html
Kind of old but I feel like posting it anyway.
Link: the fallacy of premature optimization
http://www.acm.org/ubiquity/views/v7i24_fallacy.html
Kind of old but I feel like posting it anyway.
This entry was posted on Friday, April 4th, 2008 at 5:19 am and is filed under Programming, Rant. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
« May | ||||||
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 |
April 4th, 2008 at 7:45 am
What the man said! Lock all these youngsters up in a cage with a limited platform and only an assembler at hand says I
April 4th, 2008 at 9:25 am
I’m in a situation right now where I have a massive, massive, code base written by a bunch of bright engineers who know little to nothing about optimization.
I haven’t written extensive assembly code in years but I believe it is the fact that I ‘know’ what assembly language instructions the compiler is going to produce whenever I write C code is the reason why I don’t write inherently slow code.
The problem with our current project is not that I can just point at any one location and say ’see..that is slow..make it go faster.’
There are no single points of slowness, and Vtune confirms this. Instead, the slowness comes from massive and unfettered use of the STL, Boost, smart pointers, and templates on top of templates. The code bloats like puffed rice and the slowness is not any ‘one thing’ but just all of this massive container iterating copy constructor constructing nightmare mess.
I am of the opinion that you should write all of your code fast to begin with. Unfortunately, I have learned that pretty much no one who is a lot younger than me (and didn’t spend years writing in assembly code counting instruction cycles) has any clue what it means to write ‘fast code’ to begin with.
John
April 5th, 2008 at 9:10 am
Problem is that no one really cares nowadays… as stated in the article 90s were a terrible time for that… but today is worst in game industry : ‘just wait and a new GPU will…’
Perhaps optimized code should be stated as ‘greener code’ as it saves energy…
Thanks a lot for the link, some silver bullets to my everyday fights… I love the “Never give up your performance accidentally.”
@john: Some ‘younger than you’ still learn assembly, even if not allowed to code with (maintainability by others…), and therefore cannot be as fluent as real assembly workers, compilated code checking is still very useful.