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 7BFE615D65B1; Fri, 24 Oct 2025 13:58:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7BFE615D65B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1761303526; bh=krEPm8q3io4pWY74qpHRpqydq/4vjgyUC7PHQx128t4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y6Zp91sgeQivgCx1mlon18G+kUEreM7LB6AJFqZAQai2xY3apMZ+mvxXsUklFiDy0 dvtfAPMnA8q8yzNP4sR/m2mzmp+MzdqN6GG5y4f/lEYl1TKBxWdk/5IVjgZLxZsfCn fJITFYbitf+BHWLCscMDb3VjTNcmfHc8aj82MVEw= 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 1FE9C15F7CC4 for ; Fri, 24 Oct 2025 13:51:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1FE9C15F7CC4 Received: by exim-smtp-855f5997bb-88mr2 with esmtpa (envelope-from ) id 1vCFNz-000000006vv-0QHu; Fri, 24 Oct 2025 13:51:07 +0300 To: Sergey Bronnikov Date: Fri, 24 Oct 2025 13:50:20 +0300 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9DAB542EDD08389FE833E591919D8B10BEBBEC9A01E36940B182A05F5380850407A8667FF5F001A903DE06ABAFEAF6705508BCD6EA5E8C5A552E7C6720268728EDECA3C7A6D0F0B69 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DC6E0FF9A9D6BE87EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566D857902A848E84F8B60DB940CE2F4F73282EBDC4CF679BDE0442E06D16B6901C389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0DEC8C2C8BCD2534D8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6E232F00D8D26902CA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C4DB04CA562B6C7F843847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A590EC8B6E7650A1DE5002B1117B3ED6960626E9AFA0E69BDBC81EEE05487B0209823CB91A9FED034534781492E4B8EEADF12279BA039A6965C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFF4C9D139573FDB39539100B437C08F124B28E040E2A4B63B242FFBD2EF061EC5EB3733EA1EE6A1F26EB503EC62A3E87FB19B1A9307795E39E2422C6CC32E61FE04643B77D7C2A4D55F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVRN2q9QiacRuCU6j7xnXzJU= X-DA7885C5: 33AA705E5D686455F255D290C0D534F9038F9D77EED484C4AEB695DD7633AD3AF4944AB7952A2EA45B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD242216BD248A13FB211988E4495A63B6EF82BB7A809706090E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 @@ +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 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", + 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() -- 2.51.0