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.

3 Responses to “Link: the fallacy of premature optimization”



  1. ggn Says:

    What the man said! Lock all these youngsters up in a cage with a limited platform and only an assembler at hand says I :)

  2. John W. Ratcliff Says:

    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

  3. tuan kuranes Says:

    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.

shopfr.org cialis