static array length
Jarrett Billingsley
kb3ctd2 at yahoo.com
Thu Jan 31 19:33:07 PST 2008
"Saaa" <empty at needmail.com> wrote in message
news:fntlub$1iq8$1 at digitalmars.com...
> Except that it will be on the stack :)
>
> I'll be testing the speed difference.
So you want a string buffer on the stack, or what? If it's on the stack and
you're doing a lot of operations that would otherwise involve
concatenations, it'll be faster. If it's in a function that's called a lot,
it'll be faster, since no heap allocation will occur. But, then you're
limited by the size of the array, and you can't use the same things -- no
concatenations, namely.
It's a tradeoff of syntactic niceness and flexibility of size vs. speed.
More information about the Digitalmars-d-learn
mailing list