lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 2018-01-08 09:26 PM, Paige DePol wrote:
Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

One thing I am curious about, Roberto, is the creation of tables to hold the
vargs. Won't this add significant overhead for the table allocations vs just
leaving the vargs on the stack?
That was the motivation for stack varargs. But "significant" is quite
relative. Moreover, stack varargs add an overhead (a quite small one, but
it is not zero) to all functions, even those not varargs. We do not see
vararg functions in critical paths often. Several (most?) vararg functions
have to create tables (or pay the price of 'select') anyway.

More important, table is the bread-and-butter of Lua. If we start to
demonise them, we are left with little else.

-- Roberto
Very good point about tables, Roberto! I would guess that anyone looking
for performance probably wouldn't be using varargs on critical paths anyway.

I do like the much nicer syntax for using varargs vs select() as well!

~Paige



Clearly you have not seen this yet. http://blog.ionoclast.com/2015/05/the-future-of-firth-pre-alpha2-and-beyond/

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.