lua-users home
lua-l archive

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




On 2018-01-25 07:32 PM, dyngeccetor8 wrote:
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.

The main difference between Lua 5.3 and "Lua 5.4" is that Lua 5.3 does TCO of varargs, I think. This isn't (yet) possible with "Lua 5.4" (but it'd be nice if it was).



-- Martin


--
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.