Re: What's more important optimisations or debugging?
- From: David Brown <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 May 2007 09:10:06 +0200
Dave Hansen wrote:
On May 30, 5:15 pm, rhapg...@xxxxxxxxx wrote:I'm trying to get a feel for what people now consider more important,
optimisations or debugging ability. In the past with such tight memory
limits I would have said optimisations but now with expanded-memory
parts becoming cheaper I would think that debugging ability is more
important in a development tool. It's is not exactly a black and
white question, debug or smallused, but more a ratio. eg. 50% debug/
50% optimised or 70% debug/30% optimised, etc.
The rule is "Make it right, _then_ make it fast." Fast enough is fast
enough. If the optimizer makes your code undebuggable, and you need
the debugger, don't use the optimizer.
Remember Knuth's golden rules about optimisation:
1. Don't do it.
2. (For experts only) Don't do it yet.
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.
That said, I generally set my compiler to optimize for space. It
hasn't really caused me any debugging troubles in at least 5 or 10
years. Of course, most of my debug activity resembles inserting
printf statements rather than stepping through code in an emulator.
YMMV.
In my experience, it is often much easier to debug code when you have at least some optimising enabled on the compiler. Code generated with all optimisations off is often hard to read (for example, local variables may end up on a stack, while register-based variables can be easier to understand).
mvh.,
David
Regards,.
-=Dave
- Follow-Ups:
- Re: What's more important optimisations or debugging?
- From: Hans-Bernhard Bröker
- Re: What's more important optimisations or debugging?
- From: Wilco Dijkstra
- Re: What's more important optimisations or debugging?
- References:
- What's more important optimisations or debugging?
- From: rhapgood
- Re: What's more important optimisations or debugging?
- From: Dave Hansen
- What's more important optimisations or debugging?
- Prev by Date: Re: What's more important optimisations or debugging?
- Next by Date: Good document on USB.
- Previous by thread: Re: What's more important optimisations or debugging?
- Next by thread: Re: What's more important optimisations or debugging?
- Index(es):
Relevant Pages
|