[Tarantool-patches] [PATCH v1 luajit 12/41] perf: adjust life in LuaJIT-benches
Sergey Kaplun
skaplun at tarantool.org
Fri Dec 26 11:18:59 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 my comments.
>
> Sergey
>
> On 10/24/25 13:50, 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 output is redirected to /dev/null. The checker tests the result
> > after the exact amount of iterations for the fixed field (as it is
> > declared in the original benchmark).
> > ---
> > perf/LuaJIT-benches/life.lua | 79 +++++++++++++++++++++++++++++++++++-
> > 1 file changed, 78 insertions(+), 1 deletion(-)
> >
> > diff --git a/perf/LuaJIT-benches/life.lua b/perf/LuaJIT-benches/life.lua
> > index 911d9fe1..d0e4dc98 100644
> > --- a/perf/LuaJIT-benches/life.lua
> > +++ b/perf/LuaJIT-benches/life.lua
Added the comment with the short benchmark description, as we
discussed offline:
===================================================================
diff --git a/perf/LuaJIT-benches/life.lua b/perf/LuaJIT-benches/life.lua
index 5a316364..dbf26fac 100644
--- a/perf/LuaJIT-benches/life.lua
+++ b/perf/LuaJIT-benches/life.lua
@@ -1,5 +1,12 @@
-- life.lua
--- original by Dave Bollinger <DBollinger at compuserve.com> posted to lua-l
+-- The benchmark to check the performance of array-like data
+-- structures with RW access. John Horton Conway's "Game of Life"
+-- cellular automaton.
+-- For the details see:
+-- https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
+-- Original by Dave Bollinger <DBollinger at compuserve.com> posted
+-- to lua-l:
+-- http://lua-users.org/lists/lua-l/1999-12/msg00003.html
-- modified to use ANSI terminal escape sequences
-- modified to use for instead of while
===================================================================
> > @@ -3,6 +3,8 @@
> > -- modified to use ANSI terminal escape sequences
> > -- modified to use for instead of while
> >
> > +local bench = require('bench').new(arg)
> > +
> > local write=io.write
> >
> > ALIVE="�" DEAD="�"
> We usually use ascii only symbols. Should we replace with ascii-only
> alternative?
OK, removed, since we already have the mentioning of the modification in
the test header and it can't affect the performance somehow.
===================================================================
diff --git a/perf/LuaJIT-benches/life.lua b/perf/LuaJIT-benches/life.lua
index d0e4dc98..5a316364 100644
--- a/perf/LuaJIT-benches/life.lua
+++ b/perf/LuaJIT-benches/life.lua
@@ -7,7 +7,6 @@ local bench = require('bench').new(arg)
local write=io.write
-ALIVE="¥" DEAD="þ"
ALIVE="O" DEAD="-"
function delay() -- NOTE: SYSTEM-DEPENDENT, adjust as necessary
===================================================================
> > @@ -106,6 +108,81 @@ function LIFE(w,h)
> > if gen>2000 then break end
> > --delay() -- no delay
> dead code
What do you mean about dead code?
If you are suggesting to delete the `delay()` function, I prefer not to
do it in case we want to debug the behaviour somehow. Also, this adds
additional GC objects related to the `delay()` function and its proto
(it is not much, but anyway). Also, this comment helps to understand
where the delay function should be emitted if necessary. I prefer
avoiding the modification of the code that is not vital. Also, this part
isn't modified, so I prefer to leave it as is.
> > end
> > + return thisgen
> > end
> >
> > -LIFE(40,20)
<snipped>
--
Best regards,
Sergey Kaplun
More information about the Tarantool-patches
mailing list