Re: What's more important optimisations or debugging?



David Brown wrote:

Remember Knuth's golden rules about optimisation:

1. Don't do it.
2. (For experts only) Don't do it yet.

I remember there being a third:

3. Before you do it, measure.

That applies to hand-tuning of the source code, rather than automatic optimisations in a compiler, but it's important to remember that the speed of the code is irrelevant if it does not work.

While that latter statement applies rather widely, let's keep in mind that this is the embedded programming newsgroup after all, where real-time constraints are a regular old fact of life. That means speed and correctness may not be separable just like that. Sometimes, if code is slow, that alone means it does not work.
.



Relevant Pages

  • Re: A question of style, or something more....
    ... .so under an optimising compiler the actual code would be identical. ... Javascript is delivered to its execution environment as source code ... So an important criteria for a "good" javascript complier is that it ... required in order to apply optimisations. ...
    (comp.lang.javascript)
  • Re: A question of style, or something more....
    ... .so under an optimising compiler the actual code would be identical. ... Javascript is delivered to its execution environment as source code ... So an important criteria for a "good" javascript complier is that it ... required in order to apply optimisations. ...
    (comp.lang.javascript)
  • Re: So much for Opteron 32bit compatibility ...
    ... Sun's SPECfp and SPECint performance improvements are entirely ... The optimisations have been extensively discussed ... >> and they are not SPEC specific and are usefull outside the ... performance from a combination of processor design and compiler ...
    (comp.os.vms)
  • Re: [patch 1/2] i386: use asm() like the other atomic operations already do.
    ... text data bss dec hex filename ... The inline asm stops certain optimisations from occuring. ... previous definitions allowed the compiler to optimize certain atomic ...
    (Linux-Kernel)
  • Re: Which programming language is better to start
    ... > superfluous matches evoke a warning from the compiler. ... disallow a C compiler from acquiring information. ... > the compiler cannot perform many such optimisations. ... neither the Common Lisp standard nor any of the reports on ...
    (comp.programming)