Struct Constructor Lazy

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 12 06:53:56 PDT 2017


On Wednesday, 12 July 2017 at 11:57:33 UTC, Biotronic wrote:
> Debug = no optimization.

That's not really true, you can have an optimized debug build.

dmd's -debug, -g, and -O switches are all independent. -debug 
turns on blocks labeled with the `debug` switch in code. -g adds 
info for a debugger to read. -O turns on optimizations.

You can use any combination of those.

> Looking at the generated assembly in a debug build is worthless.

I don't agree - looking at the generated assembly would put to 
rest all these questions.

But before doing that, you should show that the performance is 
actually bad. I can't imagine sending a zero argument (whether in 
a register or pushed to the stack) would ever be a serious 
problem.


More information about the Digitalmars-d-learn mailing list