Front page | perl.perl6.internals |
Postings from February 2001
Re: PDD 2, vtables
Thread Previous
|
Thread Next
From:
Branden
Date:
February 7, 2001 10:00
Subject:
Re: PDD 2, vtables
Message ID:
OE75i95HfqR77bieLYC00003881@hotmail.com
Dan Sugalski wrote:
> At 03:09 PM 2/7/2001 +0000, David Mitchell wrote:
> >A mere detail, but would it not be more efficient to just pass them
> >as extra args, ie add(PMC1, PMC2, PMC3, key1, key2, key3),
> >rather than having to potentially create and populate a tmp struct
> >just to call the function???
>
> Well, extra arguments cost. I'd originally had only a single key
optionally
> passed in, but that meant potentially two of the three PMCs had to be
real,
> rather than keyed into containers. (And thus possibly virtual) Hence the
> key array.
>
> I admit it's not a swell decision--I'm not sure whether the single
optional
> parameter is better, or several optional (or required) parameters are
> better. I can see it going either way, and I didn't put all that much
> thought into it.
>
I think filling an array costs at least as much as passing parameters, not
to mention the cost of passing that array as a parameter, also... Unless the
array is constant and can be pre-filled by the compiler (which I think is a
somewhat rare case, considering all the three arguments), or once filled
there are cases it can be reused, I'm not sure it's worth using an array to
save 2 pushes into the stack...
- Branden
Thread Previous
|
Thread Next
-
PDD 2, vtables
by Dan Sugalski
-
Re: PDD 2, vtables
by Branden
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by David Mitchell
-
Re: PDD 2, vtables
by Dan Sugalski
-
Re: PDD 2, vtables
by Simon Cozens
-
Re: PDD 2, vtables
by Dan Sugalski
-
Re: PDD 2, vtables
by Edwin Steiner
-
Re: PDD 2, vtables
by Dan Sugalski
-
Re: PDD 2, vtables
by Tim Bunce
-
Re: PDD 2, vtables
by Branden
-
Re: require < 6.x
by Brent Dax