Would you trade 0.1% in performance for a better debugging experience?

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 18 11:00:49 PST 2014


On Monday, 17 November 2014 at 23:14:32 UTC, Vladimir Panteleev 
wrote:
> I proposed to build Phobos and Druntime with stack frames 
> enabled:
>
> https://issues.dlang.org/show_bug.cgi?id=13726
>
> Stack frames add three CPU instructions to each function (two 
> in the prolog, and one in the epilog). This creates a linked 
> list which debuggers, profilers, etc. can easily walk to find 
> which function called which. They would allow debugging certain 
> classes of bugs much more easily (e.g. the recurring 
> InvalidMemoryOperationError - there's a thread about it in 
> D.learn just today), and profiling your code with polling 
> (non-instrumenting) profilers.

Having run into that error myself on Android/x86 
(https://github.com/D-Programming-Language/druntime/pull/784#issuecomment-42768642), 
it would be nice if it was easier to trace.  Losing 0.1% 
performance certainly seems worth it, but you'd think anyone 
tracking such an issue could recompile druntime/phobos 
themselves.  I was unaware that the "-gs" flag would help though, 
and nobody seems to have mentioned it in the forums or github 
until you just did.

I guess the main issue is whether we're sure it doesn't get much 
worse than 0.1%, ie that there aren't degenerate cases where we 
get worse performance declines.  Also, there's the principle of 
whether we want to force a small performance penalty, however 
minute, onto release builds of druntime/phobos for better 
debugging, which is what Walter and Martin seem to be against.


More information about the Digitalmars-d mailing list