lua-users home
lua-l archive

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


> Is it in fact the case that variadic functions have additional overhead?
> That is,  calling `fn(a, b, c)` would be cheaper if this was defined as
> `function fn(a, b, c)`, rather than `function fn(...)` ?
> 
> [...]
> 
> I had the impression that variadics carry some amount of overhead, but
> never benchmarked it.
> 
> For the sake of argument, we could compare:
> 
> function subber(...)
>    return string.sub(...)
> end
> 
> with:
> 
> function subber(str, start, finish)
>     return string.sub(str, start, finish)
> end

Why don't you compare them?

-- Roberto