lua-users home
lua-l archive

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


On 01/25/2018 11:12 PM, Soni "They/Them" L. wrote:
> On 2018-01-24 08:24 PM, dyngeccetor8 wrote:
>> In my code vararg functions not often [1]. And they have no
>> critical impact on performance. So (in my view) your benchmark
>> nicely exploits untypical case.
>>
> 
> https://github.com/SoniEx2/Stuff/tree/master/lua/Forth
> 
Well, I was talking about _my_ code. Looks like other guys
use "..." really heavy.

Anyway I like when any set of entities (sequence) may be
represented as one container (table). Even if it hurts
performance. (I tend to use Lua to do "complex" tasks.
For performance I'd use another language.)


.. here I wished to introduce function with ever more
wasteful behavior:

local print_seq = function(...) print('seq', ...) end

In Lua 5.4 it should store all arguments as tables
until garbage collection. But to prepare random argument
sequences for it's call you need to use tables anyway.
So print_seq() does not add unavoidable waste.


-- Martin