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 97B2816AFFF1; Fri, 26 Dec 2025 12:26:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 97B2816AFFF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766741183; bh=sYA2mPYpdH4rR2456Z1kmv42YGkn5ZwOY6J3+S0aPE0=; 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=F9vRcxC/OXiTgwbbKZ6GpSOBQRI1sDjbdpOLLaBl/tpCCoS4vKFuW6BnHyLxjksE2 M13T/UFG/1MaR7xBjTVpq0v1z/djYr3svvcGBUvgS7ima4SzCBKvXc/EUpkFqT5WLs dVbqie6CKYKYP4T7yTCDVAmVCb6X+y7jMvVp4VLI= Received: from send60.i.mail.ru (send60.i.mail.ru [89.221.237.155]) (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 8FB9716C658A for ; Fri, 26 Dec 2025 12:18:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8FB9716C658A Received: by exim-smtp-7b4fb89df9-lft7n with esmtpa (envelope-from ) id 1vZ3y6-000000008Cp-25Cy; Fri, 26 Dec 2025 12:18:43 +0300 To: Sergey Bronnikov Date: Fri, 26 Dec 2025 12:17:47 +0300 Message-ID: X-Mailer: git-send-email 2.52.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: 4F1203BC0FB41BD979975AF0D777FEBD390EF5E93CD1F77387498C0EC589AA68182A05F538085040C67DFCF7059F072C3DE06ABAFEAF6705455F901BB5E33427B4FA2C6BBBE99EF99799EF890AE2F8A9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE736691C7D10565E03C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6759CC434672EE6371C2A783ECEC0211ADC4224003CC836476D5A39DEEDB180909611E41BBFE2FEB2B7B4699E5C84C05A1C1B574BE4DB3D629DB8D7C534A5DD59506036836CBA915239FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD1828451B159A507268D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BF80095D1E57F4578A471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CB1724D34C644744043847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5F88EBCF2076AF7135002B1117B3ED696B7C06F5686026517715D9AB585B0EB04823CB91A9FED034534781492E4B8EEADC0A73878EBD0941BC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659709A675F42522C66B7BCF72C5DE98BA9D0FFA0F25B6BF3889AAE18C590466939B7CDC041C9440D9FB8341EE9D5BE9A0A24A764461845E16205D8439B09F6DFF08EB1720B7D397C0B6536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbaIMMYGyHbnk= X-DA7885C5: 74B8BD853578465AF255D290C0D534F97781486B7743E20265B035583A5C1F5D1A92F784E94CD4C75B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2E7455801F7976F488700636FE984EBB8B24416483B206A23E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [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 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 | 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() -- 2.52.0