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 543E9167921F; Fri, 26 Dec 2025 11:23:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 543E9167921F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766737396; bh=49lphLR7LCT3nyGZkg4iGvPJEZ1t5Rs21TfC8sqWYHk=; 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=QldTHsw44A9wyGOFgU9HqmVsd44Tm1fNeXcLCb231lcXZYo7Op+vZkmdUkiLTevBr Lm39Md5gIv6opfqBQgRHcX3YTKbqbmsUs5RUzbl0ThNIXWKim/sSPvZRjSx75+fUqQ EMUYzdybVVfaPGZcLFVKtrhT2uxb/OdgqSn7dMgM= Received: from send81.i.mail.ru (send81.i.mail.ru [89.221.237.176]) (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 924B11679206 for ; Fri, 26 Dec 2025 11:23:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 924B11679206 Received: by exim-smtp-7b4fb89df9-fjwbd with esmtpa (envelope-from ) id 1vZ36Q-000000002No-2r8y; Fri, 26 Dec 2025 11:23:15 +0300 Date: Fri, 26 Dec 2025 11:23:11 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <058ce9d7-51d4-4639-9ef1-d64878fb117b@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <058ce9d7-51d4-4639-9ef1-d64878fb117b@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD915529E8FC4AA0671CA1E07C573811262D4DDCA1B9C9DBAFD1867C24CE74E72BB5FE18E9CBFBE7C0746408DB1659DFF3428D5C4874F525AA37C7E951449EC3FF46AFFE929AA7F0A6CFEDCCBD3DDE7F493 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74323F140F3EE5B6AC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6759CC434672EE6371C2A783ECEC0211ADC4224003CC836476D5A39DEEDB180909611E41BBFE2FEB2B7B4699E5C84C05A19D3CA02D36AD503B70A89811E7EDF902D49E02A651F4AD3C9FA2833FD35BB23D9E625A9149C048EE9ECD01F8117BC8BEA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6D0C9BB9AE6BD5D69089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A526834FD63914ADAA5002B1117B3ED696C2921DC0DB9E0C2F715D9AB585B0EB04823CB91A9FED034534781492E4B8EEAD0AA277257C6A5E3DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6593B37DB2488C5856F624A0E227E5F2AFC3FE51635A0DF09A734FF57BBA19FDDA2EC94A7271F1BAF89B8341EE9D5BE9A0AFAB2A029C8A10FDB8B60D8B3384423831F30AA022727733B8CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbvyN71nQ+hAc= X-DA7885C5: A97A95230A56EC98F255D290C0D534F9D678D04D220ED5EA65B035583A5C1F5D96B812119282C5F25B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2179D2A34DFD0B451BAD1E75A19DCBB409204E670A32E9895E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! Please considery my answers below. On 23.12.25, Sergey Bronnikov wrote: > Hello, > > 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 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 | 46 ++++++++++++++++++++++++++-------- > > 1 file changed, 36 insertions(+), 10 deletions(-) > > > > diff --git a/perf/LuaJIT-benches/meteor.lua b/perf/LuaJIT-benches/meteor.lua > > index 80588ab5..f3962820 100644 > > --- a/perf/LuaJIT-benches/meteor.lua > > +++ b/perf/LuaJIT-benches/meteor.lua > > @@ -1,3 +1,4 @@ Added the comment with the short benchmark description, as we discussed offline: =================================================================== diff --git a/perf/LuaJIT-benches/meteor.lua b/perf/LuaJIT-benches/meteor.lua index 7acb86af..8cda0190 100644 --- a/perf/LuaJIT-benches/meteor.lua +++ b/perf/LuaJIT-benches/meteor.lua @@ -1,3 +1,8 @@ +-- 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 bench = require("bench").new(arg) > > > > -- Generate a decision tree based solver for the meteor puzzle. > > local function generatesolver(countinit) > > @@ -118,6 +119,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 +146,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 > please add more whitespaces. Here and below. This part wasn't touched by the patch. Let's leave this chunk as is in the original state. If we want to refactor it, this should be carefully done when we have the stable performance testing so we may verify that our changes don't affect the measurements. All stylistic fixes should be done only in cases when we have already touched the code. Without it, these changes have no sense to me. Most probably, we will never refactor this code, but we will add new tests in our own perf suite. > > 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 +211,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 = "meteror", > typo: s/meteror/meteor/ Fixed, thanks! =================================================================== diff --git a/perf/LuaJIT-benches/meteor.lua b/perf/LuaJIT-benches/meteor.lua index f3962820..7acb86af 100644 --- a/perf/LuaJIT-benches/meteor.lua +++ b/perf/LuaJIT-benches/meteor.lua @@ -217,7 +217,7 @@ end local N = tonumber(arg and arg[1]) or 10000 bench:add({ - name = "meteror", + 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 =================================================================== > > + 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() -- Best regards, Sergey Kaplun