Re: What's more important optimisations or debugging?



On Thu, 31 May 2007 12:00:56 +0000, Wilco Dijkstra wrote:


Remember Knuth's golden rules about optimisation:

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

I don't agree with this. For small programs it is easy to implement an
efficient algorithm immediately rather than start with an inefficient one.
It's hard to improve badly written code, so rewriting it from scratch
would be better than trying to fix it.

For large programs it is essential that you select the most optimal
architecture and algorithms beforehand, as it is usually impossible to
change them later. The bottlenecks are typically caused by badly
designed interfaces adding too much overhead.

In my experience well designed code is both efficient and easy to
understand, so it wouldn't need optimization (apart from fine tuning).
In other words, if you *need* to optimise an application, you got it wrong.

What you are describing is what I would image all experienced software
engineers do. But then what do you do if performance isn't good enough?
i.e. wrt the design - you got it wrong. I suspect that's when Knuth's
golden rules kick in. I could of course be barking up the wrong tree -
I haven't read Knuth.

Regards,

Paul.






.



Relevant Pages

  • Re: My take on ARC
    ... > One of the premises of ARC's design is that speed doesn't matter because ... > doesn't matter if you're not doing production work. ... programmer or operator productivity. ... other hand has had very little optimization over the years. ...
    (comp.lang.lisp)
  • Re: design of analog circuits using genetic algorithm
    ... And so does circuit design. ... using optimizers (genetic algorithms or more traditional ones) to *tweak* ... Have you done genetic optimization of circuit values? ... simulated annealing codes though fun to watch on toy problems. ...
    (sci.electronics.design)
  • Uniquifying repeated subdesign instances in BuildGates
    ... Please give me a clue on optimizing complex design in BuildGates. ... Each subdesign is also hierarchical and contains ... I have to uniquify top -level instances (and clone ... All this need more memory and future optimization work. ...
    (comp.cad.synthesis)
  • Re: Adaptive learning CPU
    ... under section 12 "Applications" there is this little baby ... Automated design, including research on composite material design ... Learning fuzzy rule base using genetic algorithms. ... Mobile communications infrastructure optimization. ...
    (talk.origins)
  • Re: Collection, enum or something else?
    ... If you have some concerns you should try to be explicit, because it becomes darn hard to guess the right way to optimize this. ... But that's a pretty micro optimization, not the kind of architectural decision that you need. ... I'd have to see more of your design but "substitute an enum for a Map" just seems like a very controversial attempt at optimization, ...
    (comp.lang.java.programmer)