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 738251651683; Fri, 26 Dec 2025 12:31:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 738251651683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766741514; bh=VWXiBq/MmiFl10/brRqGcJzZpVEpV7tyQPOjCSkdkuk=; 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=cGcpy2bnW0U7r4FyLO/1BRR7ZhiHZypzpLElDgr71qRQRkAbmJSnLug4xaMPV9560 4upZKTqpnwFuvGKLwH4F7X5DEUFuPvsw1Bu6BFIes2wMreoYfuzL8qcBm+GpRpnJD2 HdoJSkR6xjVEm1GljsJeIsM/9S3wvTHcTrSa8XsI= 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 D437216C65A0 for ; Fri, 26 Dec 2025 12:19:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D437216C65A0 Received: by exim-smtp-7b4fb89df9-lft7n with esmtpa (envelope-from ) id 1vZ3yj-000000008Cp-3Dcs; Fri, 26 Dec 2025 12:19:22 +0300 To: Sergey Bronnikov Date: Fri, 26 Dec 2025 12:17:58 +0300 Message-ID: <53e4ef7ccd9ab4aa9877b53bd66a0cce6d146cb3.1766738771.git.skaplun@tarantool.org> 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: 4F1203BC0FB41BD979975AF0D777FEBDA796860CCD9352B78452F76EDBE9CB18182A05F5380850406429699EEB3C1D253DE06ABAFEAF6705316D093284AAB0AAB4FA2C6BBBE99EF9459A72DE8AD892F7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE761966F250AC1AE21EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C8697E5A3BD298569AA28EDCD39A7D089D1A5DD911B97D79FAFF389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C084ED00A64A654CBE8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B66EA1BA7CA28B4A74CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE778B471BB9634AD8A731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5EDA011941AF1AEE35002B1117B3ED6969FCFF4900011348DB91D2EB2DEE3878C823CB91A9FED034534781492E4B8EEADC8D8B8CB12567299C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6598C36654AB487D68CCBC8A0AAA7651857C21466B96DA2D2FC34632B357EE11423BB745C1A8CFFD748B8341EE9D5BE9A0A4A2244563C2E405905D8439B09F6DFF0D71DA279E89F92E26536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbH4pvuKcjyAw= X-DA7885C5: 4BBDA75430F00DF7F255D290C0D534F917913BB410FFE9308BFC1EB2BC99E4DF7EA9A0FE895CFB165B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2D33B135A32448EEB8700636FE984EBB80110DEDE0FA26B6AE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 27/41] perf: adjust scimark-2010-12-20 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 default arguments are adjusted according to the file. The arguments to the script still can be provided in the command line run. The time for each subsequent benchmark is increased up to 4 seconds, accoring the defaults in the "bench" framework. The main difference between this test and others that will be added in next commits is the usage of FFI arrays instead of plain Lua tables. --- perf/LuaJIT-benches/scimark-2010-12-20.lua | 92 ++++++++++++---------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/perf/LuaJIT-benches/scimark-2010-12-20.lua b/perf/LuaJIT-benches/scimark-2010-12-20.lua index 353acb7c..4b80ffe2 100644 --- a/perf/LuaJIT-benches/scimark-2010-12-20.lua +++ b/perf/LuaJIT-benches/scimark-2010-12-20.lua @@ -9,25 +9,26 @@ local SCIMARK_VERSION = "2010-12-10" local SCIMARK_COPYRIGHT = "Copyright (C) 2006-2010 Mike Pall" -local MIN_TIME = 2.0 +local bench = require("bench").new(arg) + local RANDOM_SEED = 101009 -- Must be odd. local SIZE_SELECT = "small" local benchmarks = { "FFT", "SOR", "MC", "SPARSE", "LU", small = { - FFT = { 1024 }, - SOR = { 100 }, - MC = { }, - SPARSE = { 1000, 5000 }, - LU = { 100 }, + FFT = { params = { 1024 }, cycles = 50000, }, + SOR = { params = { 100 }, cycles = 50000, }, + MC = { params = { }, cycles = 15e7, }, + SPARSE = { params = { 1000, 5000 }, cycles = 15e4, }, + LU = { params = { 100 }, cycles = 5000, }, }, large = { - FFT = { 1048576 }, - SOR = { 1000 }, - MC = { }, - SPARSE = { 100000, 1000000 }, - LU = { 1000 }, + FFT = { params = { 1048576 }, cycles = 25, }, + SOR = { params = { 1000 }, cycles = 500, }, + MC = { params = { }, cycles = 15e7, }, + SPARSE = { params = { 100000, 1000000 }, cycles = 1500, }, + LU = { params = { 1000 }, cycles = 50, }, }, } @@ -342,48 +343,48 @@ local function fmtparams(p1, p2) return "" end -local function measure(min_time, name, ...) +local function measure(name, cycles, ...) array_init() rand_init(RANDOM_SEED) local run = benchmarks[name](...) - local cycles = 1 - repeat - local tm = clock() - local flops = run(cycles, ...) - tm = clock() - tm - if tm >= min_time then - local res = flops / tm * 1.0e-6 - local p1, p2 = ... - printf("%-7s %8.2f %s\n", name, res, fmtparams(...)) - return res - end - cycles = cycles * 2 - until false + local flops = run(cycles, ...) + return flops end -printf("Lua SciMark %s based on SciMark 2.0a. %s.\n\n", - SCIMARK_VERSION, SCIMARK_COPYRIGHT) - while arg and arg[1] do local a = table.remove(arg, 1) - if a == "-noffi" then + if a == "noffi" then package.preload.ffi = nil - elseif a == "-small" then + elseif a == "small" then SIZE_SELECT = "small" - elseif a == "-large" then + elseif a == "large" then SIZE_SELECT = "large" elseif benchmarks[a] then - local p = benchmarks[SIZE_SELECT][a] - measure(MIN_TIME, a, tonumber(arg[1]) or p[1], tonumber(arg[2]) or p[2]) + local cycles = benchmarks[SIZE_SELECT][a].cycles + local p = benchmarks[SIZE_SELECT][a].params + local b + b = { + name = a, + -- XXX: The description of tests for each function is too + -- inconvenient. + skip_check = true, + payload = function() + local flops = measure(a, cycles, tonumber(arg[1]) or p[1], + tonumber(arg[2]) or p[2]) + b.items = flops + end, + } + bench:add(b) + bench:run_and_report() return else - printf("Usage: scimark [-noffi] [-small|-large] [BENCH params...]\n\n") - printf("BENCH -small -large\n") + printf("Usage: scimark [noffi] [small|large] [BENCH params...]\n\n") + printf("BENCH small large\n") printf("---------------------------------------\n") for _,name in ipairs(benchmarks) do printf("%-7s %-13s %s\n", name, - fmtparams(unpack(benchmarks.small[name])), - fmtparams(unpack(benchmarks.large[name]))) + fmtparams(unpack(benchmarks.small[name].params)), + fmtparams(unpack(benchmarks.large[name].params))) end printf("\n") os.exit(1) @@ -393,8 +394,19 @@ end local params = benchmarks[SIZE_SELECT] local sum = 0 for _,name in ipairs(benchmarks) do - sum = sum + measure(MIN_TIME, name, unpack(params[name])) + local cycles = params[name].cycles + local b + b = { + name = name, + -- XXX: The description of tests for each function is too + -- inconvenient. + skip_check = true, + payload = function() + local flops = measure(name, cycles, unpack(params[name].params)) + b.items = flops + end, + } + bench:add(b) end -printf("\nSciMark %8.2f [%s problem sizes]\n", sum / #benchmarks, SIZE_SELECT) -io.flush() +bench:run_and_report() -- 2.52.0