From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 5387C16D225E; Fri, 2 Jan 2026 13:07:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5387C16D225E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1767348456; bh=thuVHbsIsA72CLi5CpNbOneovU0/dWLlYvgpv1deYOQ=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=yoUie4yRVCyubS29l6Ds69PZM0ibCTs9oslWgZjRjmehj7hT5hUDWyhRU0+6VA700 /aa74hI0tPE1CRoQpsHaW9zacvuPhi1zcGL+RSgvguuLmqaMfqw8mdLNBJbv3NYhsX MojZgsnZkyO18VrA+vr0zYGqgetnxa6jIL5vFmb0= Received: from send57.i.mail.ru (send57.i.mail.ru [89.221.237.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A981516D225E for ; Fri, 2 Jan 2026 13:07:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A981516D225E Received: by exim-smtp-7b4fb89df9-wdkm4 with esmtpa (envelope-from ) id 1vbc4E-00000000N5c-2mnT; Fri, 02 Jan 2026 13:07:35 +0300 Content-Type: multipart/alternative; boundary="------------yJekxMXWpo6oHMOnJ9oPktWR" Message-ID: <8e75f0a4-e17d-440b-9ef1-e27a5e97aa13@tarantool.org> Date: Fri, 2 Jan 2026 13:07:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <3d7e6442ea25d89184fce87709e0fb01998de48b.1766738771.git.skaplun@tarantool.org> In-Reply-To: <3d7e6442ea25d89184fce87709e0fb01998de48b.1766738771.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD136B1DE29D0A1418CBDA0D2A8E376019182A05F538085040BB9C868242DB96613DE06ABAFEAF6705141FB8E6F95739A57C6D7116AD80944279AC4C993248420D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE795530B80AF2ADB7BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F88016AB904663428638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B276FFEF77FA3A76842E070BE324C7D3C4A00CA6FC302203D2F6B57BC7E64490618DEB871D839B73339E8FC8737B5C22494854413538E1713FCC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0A29E2F051442AF778941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C087909452E6FED0217B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F140C956E756FBB7A86A01F665E7D37C5B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B56969FF77163EA2B75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5A6E0A462E2DDF3015002B1117B3ED69628627BD1767034C0484B8D70797403F6823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659A09777AB17ADBD3A23452BA68CEEB9DF54FBFE86A94E1ABD9B036A3EBC78C64536451ED1634A1DF1B8341EE9D5BE9A0A30E4C466689CB3F72036FD628A275DAAC63967C6A4FCBD5A8CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVTZJppT4ZVHRGzH2C8tqUD0= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F258845881185399016AF949741D06F8E7BD5C49A15B4084C8D062D47C9851A8B9F6C68F645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 12/41] perf: adjust life in LuaJIT-benches X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------yJekxMXWpo6oHMOnJ9oPktWR Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Sergey! Thanks for the patch! LGTM 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 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 | 89 ++++++++++++++++++++++++++++++++++-- > 1 file changed, 86 insertions(+), 3 deletions(-) > > diff --git a/perf/LuaJIT-benches/life.lua b/perf/LuaJIT-benches/life.lua > index 911d9fe1..dbf26fac 100644 > --- a/perf/LuaJIT-benches/life.lua > +++ b/perf/LuaJIT-benches/life.lua > @@ -1,11 +1,19 @@ > -- life.lua > --- original by Dave Bollinger 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 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 > > +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 +114,81 @@ function LIFE(w,h) > if gen>2000 then break end > --delay() -- no delay > end > + return thisgen > end > > -LIFE(40,20) > +-- Result of the LIFE(40, 20) after 2000 generations. > +--[[ > +---------------------------------------- > +---------------------------------------- > +--OO--------------------------O--------- > +-OO--------------------------O-O-------- > +---O--------------------------O--------- > +---------------------------------------- > +---------------------------------------- > +---------------------------------------- > +---------------------------------------- > +---------------------------------------- > +---------------------------------------- > +---------------------------------------- > +---O------------------------------------ > +--O-O----------------------------------- > +--O-O----------------------------------- > +---O------------------------------------ > +---------------------------------------- > +-------OO------------------------------- > +-------OO------------------------------- > +---------------------------------------- > +]] > + > +local function check_life(thisgen, w, h) > + local expected_cells = ARRAY2D(w, h) > + for y = 1, h do > + for x = 1, w do > + expected_cells[y][x] = false > + end > + end > + local alive_cells = { > + {3, 3}, {3, 4}, {3, 31}, > + {4, 2}, {4, 3}, {4, 30}, {4, 32}, > + {5, 4}, {5, 31}, > + {13, 4}, > + {14, 3}, {14, 5}, > + {15, 3}, {15, 5}, > + {16, 4}, > + {18, 8}, {18, 9}, > + {19, 8}, {19, 9}, > + } > + for _, cell in ipairs(alive_cells) do > + local y, x = cell[1], cell[2] > + expected_cells[y][x] = true > + end > + for y = 1, h do > + for x = 1, w do > + assert(thisgen[y][x] > 0 == expected_cells[y][x], > + ('Incorrect value for cell (%d, %d)'):format(x, y)) > + end > + end > + return true > +end > + > +local stdout = io.output() > + > +bench:add({ > + name = 'life', > + setup = function() > + io.output('/dev/null') > + end, > + payload = function() > + return LIFE(40, 20) > + end, > + teardown = function() > + io.output(stdout) > + end, > + checker = function(res) > + return check_life(res, 40, 20) > + end, > + items = 2000 * 40 * 20, > +}) > + > +bench:run_and_report() --------------yJekxMXWpo6oHMOnJ9oPktWR Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Sergey!

Thanks for the patch! LGTM

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 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 | 89 ++++++++++++++++++++++++++++++++++--
 1 file changed, 86 insertions(+), 3 deletions(-)

diff --git a/perf/LuaJIT-benches/life.lua b/perf/LuaJIT-benches/life.lua
index 911d9fe1..dbf26fac 100644
--- a/perf/LuaJIT-benches/life.lua
+++ b/perf/LuaJIT-benches/life.lua
@@ -1,11 +1,19 @@
 -- life.lua
--- original by Dave Bollinger <DBollinger@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@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
 
+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 +114,81 @@ function LIFE(w,h)
     if gen>2000 then break end
     --delay()		-- no delay
   end
+  return thisgen
 end
 
-LIFE(40,20)
+-- Result of the LIFE(40, 20) after 2000 generations.
+--[[
+----------------------------------------
+----------------------------------------
+--OO--------------------------O---------
+-OO--------------------------O-O--------
+---O--------------------------O---------
+----------------------------------------
+----------------------------------------
+----------------------------------------
+----------------------------------------
+----------------------------------------
+----------------------------------------
+----------------------------------------
+---O------------------------------------
+--O-O-----------------------------------
+--O-O-----------------------------------
+---O------------------------------------
+----------------------------------------
+-------OO-------------------------------
+-------OO-------------------------------
+----------------------------------------
+]]
+
+local function check_life(thisgen, w, h)
+  local expected_cells = ARRAY2D(w, h)
+  for y = 1, h do
+    for x = 1, w do
+      expected_cells[y][x] = false
+    end
+  end
+  local alive_cells = {
+    {3, 3}, {3, 4}, {3, 31},
+    {4, 2}, {4, 3}, {4, 30}, {4, 32},
+    {5, 4}, {5, 31},
+    {13, 4},
+    {14, 3}, {14, 5},
+    {15, 3}, {15, 5},
+    {16, 4},
+    {18, 8}, {18, 9},
+    {19, 8}, {19, 9},
+  }
+  for _, cell in ipairs(alive_cells) do
+    local y, x = cell[1], cell[2]
+    expected_cells[y][x] = true
+  end
+  for y = 1, h do
+    for x = 1, w do
+      assert(thisgen[y][x] > 0 == expected_cells[y][x],
+             ('Incorrect value for cell (%d, %d)'):format(x, y))
+    end
+  end
+  return true
+end
+
+local stdout = io.output()
+
+bench:add({
+  name = 'life',
+  setup = function()
+    io.output('/dev/null')
+  end,
+  payload = function()
+    return LIFE(40, 20)
+  end,
+  teardown = function()
+    io.output(stdout)
+  end,
+  checker = function(res)
+    return check_life(res, 40, 20)
+  end,
+  items = 2000 * 40 * 20,
+})
+
+bench:run_and_report()
--------------yJekxMXWpo6oHMOnJ9oPktWR--