[Tarantool-patches] [PATCH v2 luajit 27/41] perf: adjust scimark-2010-12-20 in LuaJIT-benches

Sergey Kaplun skaplun at tarantool.org
Sat Jan 3 09:10:51 MSK 2026


Hi, Sergey!
Thanks for the review!
Please consider my answer below.

On 02.01.26, Sergey Bronnikov wrote:
> Hi, Sergey!
> 
> thanks for the patch! LGTM with a minor comment
> 
> Sergey
> 
> On 12/26/25 12:17, Sergey Kaplun wrote:
> > This patch adjusts the aforementioned test to use the benchmark
> > framework introduced before. The default arguments are adjusted
> > according to the <PARAM_x86.txt> file. The arguments to the script still
> > can be provided in the command line run.
> >
> > The time for each subsequent benchmark is increased up to 4 seconds,
> > accoring the defaults in the "bench" framework. The main difference
> > between this test and others that will be added in next commits is
> > the usage of FFI arrays instead of plain Lua tables.
> > ---
> >   perf/LuaJIT-benches/scimark-2010-12-20.lua | 92 ++++++++++++----------
> >   1 file changed, 52 insertions(+), 40 deletions(-)
> >
> > diff --git a/perf/LuaJIT-benches/scimark-2010-12-20.lua b/perf/LuaJIT-benches/scimark-2010-12-20.lua
> > index 353acb7c..4b80ffe2 100644
> > --- a/perf/LuaJIT-benches/scimark-2010-12-20.lua
> > +++ b/perf/LuaJIT-benches/scimark-2010-12-20.lua

<snipped>

> >   while arg and arg[1] do
> >     local a = table.remove(arg, 1)
> > -  if a == "-noffi" then
> > +  if a == "noffi" then
> >       package.preload.ffi = nil
> > -  elseif a == "-small" then
> > +  elseif a == "small" then
> >       SIZE_SELECT = "small"
> > -  elseif a == "-large" then
> > +  elseif a == "large" then
> these options are absent in usage (--help), why?

I suppose there is no need for it.
This still may be done if you are exploring the benchmark behaviour. But
you will read its sources in this case anyway.

These options are retained for backward compatibility with the original
version.

> >       SIZE_SELECT = "large"
> >     elseif benchmarks[a] then
> > -    local p = benchmarks[SIZE_SELECT][a]
> > -    measure(MIN_TIME, a, tonumber(arg[1]) or p[1], tonumber(arg[2]) or p[2])
> > +    local cycles = benchmarks[SIZE_SELECT][a].cycles
> > +    local p = benchmarks[SIZE_SELECT][a].params
> > +    local b
> > +    b = {
> > +      name = a,
> > +      -- XXX: The description of tests for each function is too
> > +      -- inconvenient.
> > +      skip_check = true,
> > +      payload = function()
> > +        local flops = measure(a, cycles, tonumber(arg[1]) or p[1],
> > +                              tonumber(arg[2]) or p[2])
> > +        b.items = flops
> > +      end,
> > +    }
> > +bench:add(b)
> > +bench:run_and_report()
> >       return
> >     else
> > -    printf("Usage: scimark [-noffi] [-small|-large] [BENCH params...]\n\n")
> > -    printf("BENCH   -small         -large\n")
> > +    printf("Usage: scimark [noffi] [small|large] [BENCH params...]\n\n")
> > +    printf("BENCH   small         large\n")

<snipped>

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list