lua-users home
lua-l archive

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


2016-06-23 13:31 GMT+02:00 Viacheslav Usov <via.usov@gmail.com>:
> On Thu, Jun 23, 2016 at 1:16 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
>
>> I have attached another micro benchmark for iterating varargs. It appears
>> that the break-even point is around 4 arguments in `...` (which is sooner
>> than I expected):
>
> I'd interpret your results a little differently: select is clearly
> preferential perf-wise for one or two arguments, then just use {...}.

I would summarize it this way: '{...}' never costs more than a fraction
of a second, 'select' may cost several minutes.

I am reminded of my colleague Andrzej Dąbrowski from the late
1960's. He knew the number of machine cycles used by every
instruction on the IBM System 360 Model 40, and the exact machine
code that every line of Fortran compiled to. No matter how fast any
of the rest of us could make a program run, he could always find
a way to make it (slightly) faster.