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 B1567169B68A; Fri, 2 Jan 2026 13:18:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B1567169B68A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1767349137; bh=3EWG0FGhnBn74I2J/B0oYpX/oD2kG305sdZyyZRQjjk=; 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=xC4y4se2BOaKs147mHLumXmaEuaQloWBIw8jRs8bK1qf8heSSLNgj1pxwl8xtqY29 8DAyoFVdvX2IY2ZChG9HOrzsM88JYaOBxgFZ4hcFqm3pE3sT4/Jd/9XIafHeIKgwUR Rs6HIKgx4WJonP8fb6g79Kn/4vkrHJkKLYo4UZHA= Received: from send266.i.mail.ru (send266.i.mail.ru [95.163.59.105]) (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 BC805169B68A for ; Fri, 2 Jan 2026 13:18:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BC805169B68A Received: by exim-smtp-7b4fb89df9-kbjdg with esmtpa (envelope-from ) id 1vbcFC-00000000Oqa-36We; Fri, 02 Jan 2026 13:18:55 +0300 Content-Type: multipart/alternative; boundary="------------Qpc0LnEpBndy2KO3ruUZoSGI" Message-ID: <23aea8c7-74b6-4df9-93bb-bbb0207a2198@tarantool.org> Date: Fri, 2 Jan 2026 13:18:54 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD390EF5E93CD1F77387498C0EC589AA68182A05F538085040153A6895ED0383323DE06ABAFEAF67051FCF63101D3F6ACD5D643DEFC2001D5396BB91BDF9958CC6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C4A7E4C0BFE8628DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566D1B0EEF93386A5FD7105B45C86B2E9F39F2999C7409C6175615D590A2B0DCE29389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249EF34D665BE9CA8B776E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8BF858E60A7739E4253AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7350555CCFDA08FA3FAC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5ECF0529C2791D0705002B1117B3ED696AF537C88A518655314DB8790748E3E77823CB91A9FED034534781492E4B8EEAD09F854029C6BD0DABDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6598C85488941CACECAF1F6E5F03CD3C02233FEA04E79C6328FBE856F94AB9E03220DDE3196A77604DFB8341EE9D5BE9A0A3C1A175CAEE3AD87BCC8C997A6E340005D701F814B7F2B448CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVTZJppT4ZVHR0sn2GCR2H3E= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458A6C8477EAB916DC01F93A76BF6F7B0A6B6AC6D9EB4B06F8F4407E1127DC9880D645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 16/41] perf: adjust meteor 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. --------------Qpc0LnEpBndy2KO3ruUZoSGI Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 arguments to the script still can be > provided in the command line run. However, the values greater than the > maximum possible solutions found do not affect the time of execution for > this benchmark. Hence, the number of items to proceed is considered > constant as the maximum possible number of solutions. > --- > perf/LuaJIT-benches/meteor.lua | 51 +++++++++++++++++++++++++++------- > 1 file changed, 41 insertions(+), 10 deletions(-) > > diff --git a/perf/LuaJIT-benches/meteor.lua b/perf/LuaJIT-benches/meteor.lua > index 80588ab5..8cda0190 100644 > --- a/perf/LuaJIT-benches/meteor.lua > +++ b/perf/LuaJIT-benches/meteor.lua > @@ -1,3 +1,9 @@ > +-- Benchmark to check various operations via the Meteor puzzle > +-- solver. > +-- For the details see: > +--https://pybenchmarks.org/u64q/performance.php?test=meteor > + > +local bench = require("bench").new(arg) > > -- Generate a decision tree based solver for the meteor puzzle. > local function generatesolver(countinit) > @@ -118,6 +124,10 @@ local function printresult() > printboard(smax) > end > > +local function getresult() > + return countinit-count, smin, smax > +end > + > -- Generate piece lookup array from the order of use. > local function genp() > local p = pcs > @@ -141,7 +151,7 @@ local function f91(k) > local s = p[b0] ]] > for p=2,99 do if ok[p] then s = s.."..p[b"..p.."]" end end > s = s..[[ > - -- Remember min/max boards, dito for the symmetric board. > + -- Remember min/max boards, ditto for the symmetric board. > if not smin then smin = s; smax = s > elseif s < smin then smin = s elseif s > smax then smax = s end > s = reverse(s) > @@ -206,15 +216,36 @@ local f93 = f91 > end > > -- Compile and return solver function and result getter. > - return loadstring(s.."return f0, printresult\n", "solver")(countinit) > + return loadstring(s.."return f0, printresult, getresult\n", "solver")(countinit) > end > > --- Generate the solver function hierarchy. > -local solver, printresult = generatesolver(tonumber(arg and arg[1]) or 10000) > - > --- The optimizer for LuaJIT 1.1.x is not helpful here, so turn it off. > -if jit and jit.opt and jit.version_num < 10200 then jit.opt.start(0) end > +local N = tonumber(arg and arg[1]) or 10000 > + > +bench:add({ > + name = "meteor", > + setup = function() > + -- The optimizer for LuaJIT 1.1.x is not helpful here, so turn it off. > + if jit and jit.opt and jit.version_num < 10200 then jit.opt.start(0) end > + end, > + payload = function() > + -- Generate the solver function hierarchy. > + local solver, printresult, getresult = generatesolver(N) > + > + -- Run the solver protected to get partial results (max count or ctrl-c). > + pcall(solver, 0) > + > + local n, smin, smax = getresult() > + return {n = n, smin = smin, smax = smax} > + end, > + checker = function(res) > + if N >= 2097 then > + assert(res.n == 2098, "Incorrect solutions number") > + assert(res.smin == "00001222012661126155865558633348893448934747977799") > + assert(res.smax == "99998966856688568255777257472014220144031400311333") > + end > + return true > + end, > + items = 2098, > +}) > > --- Run the solver protected to get partial results (max count or ctrl-c). > -pcall(solver, 0) > -printresult() > +bench:run_and_report() --------------Qpc0LnEpBndy2KO3ruUZoSGI Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

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 arguments to the script still can be
provided in the command line run. However, the values greater than the
maximum possible solutions found do not affect the time of execution for
this benchmark. Hence, the number of items to proceed is considered
constant as the maximum possible number of solutions.
---
 perf/LuaJIT-benches/meteor.lua | 51 +++++++++++++++++++++++++++-------
 1 file changed, 41 insertions(+), 10 deletions(-)

diff --git a/perf/LuaJIT-benches/meteor.lua b/perf/LuaJIT-benches/meteor.lua
index 80588ab5..8cda0190 100644
--- a/perf/LuaJIT-benches/meteor.lua
+++ b/perf/LuaJIT-benches/meteor.lua
@@ -1,3 +1,9 @@
+-- Benchmark to check various operations via the Meteor puzzle
+-- solver.
+-- For the details see:
+-- https://pybenchmarks.org/u64q/performance.php?test=meteor
+
+local bench = require("bench").new(arg)
 
 -- Generate a decision tree based solver for the meteor puzzle.
 local function generatesolver(countinit)
@@ -118,6 +124,10 @@ local function printresult()
   printboard(smax)
 end
 
+local function getresult()
+  return countinit-count, smin, smax
+end
+
 -- Generate piece lookup array from the order of use.
 local function genp()
   local p = pcs
@@ -141,7 +151,7 @@ local function f91(k)
     local s = p[b0] ]]
   for p=2,99 do if ok[p] then s = s.."..p[b"..p.."]" end end
   s = s..[[
-    -- Remember min/max boards, dito for the symmetric board.
+    -- Remember min/max boards, ditto for the symmetric board.
     if not smin then smin = s; smax = s
     elseif s < smin then smin = s elseif s > smax then smax = s end
     s = reverse(s)
@@ -206,15 +216,36 @@ local f93 = f91
   end
 
   -- Compile and return solver function and result getter.
-  return loadstring(s.."return f0, printresult\n", "solver")(countinit)
+  return loadstring(s.."return f0, printresult, getresult\n", "solver")(countinit)
 end
 
--- Generate the solver function hierarchy.
-local solver, printresult = generatesolver(tonumber(arg and arg[1]) or 10000)
-
--- The optimizer for LuaJIT 1.1.x is not helpful here, so turn it off.
-if jit and jit.opt and jit.version_num < 10200 then jit.opt.start(0) end
+local N = tonumber(arg and arg[1]) or 10000
+
+bench:add({
+  name = "meteor",
+  setup = function()
+    -- The optimizer for LuaJIT 1.1.x is not helpful here, so turn it off.
+    if jit and jit.opt and jit.version_num < 10200 then jit.opt.start(0) end
+  end,
+  payload = function()
+    -- Generate the solver function hierarchy.
+    local solver, printresult, getresult = generatesolver(N)
+
+    -- Run the solver protected to get partial results (max count or ctrl-c).
+    pcall(solver, 0)
+
+    local n, smin, smax = getresult()
+    return {n = n, smin = smin, smax = smax}
+  end,
+  checker = function(res)
+    if N >= 2097 then
+      assert(res.n == 2098, "Incorrect solutions number")
+      assert(res.smin == "00001222012661126155865558633348893448934747977799")
+      assert(res.smax == "99998966856688568255777257472014220144031400311333")
+    end
+    return true
+  end,
+  items = 2098,
+})
 
--- Run the solver protected to get partial results (max count or ctrl-c).
-pcall(solver, 0)
-printresult()
+bench:run_and_report()
--------------Qpc0LnEpBndy2KO3ruUZoSGI--