[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Returning nil vs returning nothing
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 1 Nov 2020 13:53:36 -0300
> 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