Reference value of structs not optimized or inlined?

Jeremie Pelletier jeremiep at gmail.com
Wed Aug 26 11:48:00 PDT 2009


Jeremie Pelletier Wrote:

> Bill Baxter Wrote:
> 
> > On Wed, Aug 26, 2009 at 11:01 AM, Jeremie Pelletier<jeremiep at gmail.com> wrote:
> > > I just noticed that when a method has a ref parameter for a struct, it doesn't get inlined:
> > 
> > Here's the bug you want to vote up:
> > 
> > http://d.puremagic.com/issues/show_bug.cgi?id=2008
> > 
> > It is indeed a sad situation.
> > 
> > --bb
> 
> Just voted, it should be marked as urgent, I can't even begin to imagine the amount of code that will need to be converted back to D syntax once it is fixed.
> 
> Thanks.

Just to stress out how important this is; I have a small loop calculating a 3x2 rotation matrix used with either Direct2D or Cairo every 10ms which transform the text "Hello World" in a window. CPU usage drops by 7-10% when using C style pointers instead of D storage classes. I haven't even optimized with SSE and whatnot yet, just removing the stack frame initialization overhead.

It would be way worse with the out storage class since the memory also has to be zero filled, which is overkill to me since its much better to just throw an error "out variable x used before initialization".



More information about the Digitalmars-d mailing list