[Tarantool-patches] [PATCH v1 luajit 34/41] perf: adjust series in LuaJIT-benches

Sergey Kaplun skaplun at tarantool.org
Fri Dec 26 11:37:05 MSK 2025


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

On 17.11.25, Sergey Bronnikov wrote:
> Hi, Sergey,
> 
> thanks for the patch! See comments below.
> 
> Sergey
> 
> On 10/24/25 14:00, 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.
> > ---
> >   perf/LuaJIT-benches/series.lua | 20 ++++++++++++++------
> >   1 file changed, 14 insertions(+), 6 deletions(-)
> >
> > diff --git a/perf/LuaJIT-benches/series.lua b/perf/LuaJIT-benches/series.lua
> > index f766cb32..3dc970c5 100644
> > --- a/perf/LuaJIT-benches/series.lua
> > +++ b/perf/LuaJIT-benches/series.lua

Added the comment with the short benchmark description, as we
discussed offline:

===================================================================
diff --git a/perf/LuaJIT-benches/series.lua b/perf/LuaJIT-benches/series.lua
index 3dc970c5..56f012b7 100644
--- a/perf/LuaJIT-benches/series.lua
+++ b/perf/LuaJIT-benches/series.lua
@@ -1,3 +1,7 @@
+-- The benchmark to check the performance of FP arithmetics, power
+-- operation, and trigonometrical functions. Calculates the
+-- integrals of sin/cos functions.
+
 local bench = require("bench").new(arg)
 
 local function integrate(x0, x1, nsteps, omegan, f)
===================================================================

> > @@ -1,3 +1,4 @@
> > +local bench = require("bench").new(arg)
> >   
> >   local function integrate(x0, x1, nsteps, omegan, f)
> >     local x, dx = x0, (x1-x0)/nsteps
> > @@ -26,9 +27,16 @@ local function series(n)
> >   end
> >   
> >   local n = tonumber(arg and arg[1]) or 10000
> > -local tm = os.clock()
> > -local t = series(n)
> > -tm = os.clock() - tm
> > -assert(math.abs(t[1]-2.87295) < 0.00001)
> > -io.write(string.format("size %d, %.2f s, %.1f iterations/s\n",
> > -                       n, tm, (2*n-1)/tm))
> debug print was lost, is it intentional?

It is not the debug print, but rather the information about the
benchmark performance. We collect this stat automatically by the bench
module.

> > +
> > +bench:add({
> > +  name = "series",
> > +  checker = function(res)
> > +    return math.abs(res[1]-2.87295) < 0.00001
> add more whitespaces

Added:

===================================================================
diff --git a/perf/LuaJIT-benches/series.lua b/perf/LuaJIT-benches/series.lua
index 3dc970c5..16d34fdf 100644
--- a/perf/LuaJIT-benches/series.lua
+++ b/perf/LuaJIT-benches/series.lua
@@ -31,7 +31,7 @@ local n = tonumber(arg and arg[1]) or 10000
 bench:add({
   name = "series",
   checker = function(res)
-    return math.abs(res[1]-2.87295) < 0.00001
+    return math.abs(res[1] - 2.87295) < 0.00001
   end,
   payload = function()
     return series(n)
===================================================================

> > +  end,
> > +  payload = function()
> > +    return series(n)
> > +  end,
> > +  items = 2 * n - 1,
> > +})
> > +
> > +bench:run_and_report()

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list