ref arguments
Bill Baxter
wbaxter at gmail.com
Mon Sep 21 13:29:11 PDT 2009
On Mon, Sep 21, 2009 at 12:53 PM, Jeremie Pelletier <jeremiep at gmail.com> wrote:
>>> Right now the compiler makes a temporary copy of referenced parameters on
>>> the stack, calls the function with a pointer to the stack copy, and once the
>>> function returns copies the modified temporary back to its original
>>> location. This is quite considerable overhead.
>>
>> Are you sure this is true? I don't have a d2 compiler right now, but that
>> sounds like a *huge* step in the wrong direction. D1 does not do this
>> (tested dmd 1.046).
>
> Yeah I started a thread about that a few months ago in digitalmars.D, its
> something that's on the bugzilla I believe.
I think this is the only bugzilla bug about speed of reference parameters:
http://d.puremagic.com/issues/show_bug.cgi?id=2008
It does not mention the copying issue in D2 you talk about, only lack
of inlining in D1 and D2. But I think the asm code posted there may
be doing that copying. Not a big ASM guru though.
To anyone who thinks that poor optimization of ref args is an
important issue: please vote for the bug!
--bb
More information about the Digitalmars-d-learn
mailing list