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 ACE8D16BF2E2; Fri, 26 Dec 2025 12:29:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ACE8D16BF2E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766741364; bh=v61xMmObb1FldnrKAouUbNT8TkkObgGahiRVxclOxyo=; 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=cXwdRFxXogsoQTW+W1TpIb4BViYrtiwJkCMBcqZ0t11dLjGfrZxzN3WbqJwcKu1FB 1ownH9U2crmPKt+0BCpyJqyScCeOjZWGzw41Vzv+To57nZAVVvBqymMAQAyCijYURj R5heXHBbuDSRqKWiE1+DJs8q1WTfazgnURJD/61I= Received: from send82.i.mail.ru (send82.i.mail.ru [89.221.237.177]) (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 6FFC516C6596 for ; Fri, 26 Dec 2025 12:19:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6FFC516C6596 Received: by exim-smtp-7b4fb89df9-lft7n with esmtpa (envelope-from ) id 1vZ3yP-000000008Cp-2eWa; Fri, 26 Dec 2025 12:19:02 +0300 To: Sergey Bronnikov Date: Fri, 26 Dec 2025 12:17:53 +0300 Message-ID: <7554bb7b0bed0d3aaae0179b523b970f70c04e3a.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: 4F1203BC0FB41BD979975AF0D777FEBDBD402C266276CBAD49C55E60069EDAD4182A05F538085040BCB1FA8EF48BAD803DE06ABAFEAF67058A07072ACA82B10AB4FA2C6BBBE99EF9AF5C6C36E0A87868 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B7733D0215A2F71AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C869AA40F1F27A9BEC4A8EDCD39A7D089D1A51A83AD4EBFA0B84389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C045A75973B56231AD8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6A70DDFFB3186CBC5CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE778B471BB9634AD8A731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A50163F3C13B2E8ABD5002B1117B3ED69691798320FDABFD7E250A03108B67251B823CB91A9FED034534781492E4B8EEADA2D5570B22232E1EC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659C507FFB0BFEA5CAEAB283180DCA0A6309185CED1E80841CFA518488B027B78DC4D444897D4D6A03DB8341EE9D5BE9A0A32A2A11A7069166205D8439B09F6DFF05255CCEE282B580E6536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbi4VhLPylSBg= X-DA7885C5: 594C559A1F00723DF255D290C0D534F9011BFFB9CEEAE8704875D5A1C598AD3DDA58B87FFE43C3A55B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2D02E826A8E600FC08700636FE984EBB8A605D9790A31A07FE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 22/41] perf: adjust pidigits-nogmp 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 output is redirected to /dev/null. The check is skipped since it is very inconvenient to store the huge file in the repository with the reference value. --- perf/LuaJIT-benches/pidigits-nogmp.lua | 56 +++++++++++++++++++------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/perf/LuaJIT-benches/pidigits-nogmp.lua b/perf/LuaJIT-benches/pidigits-nogmp.lua index 63a1cb0e..cdfa7fcb 100644 --- a/perf/LuaJIT-benches/pidigits-nogmp.lua +++ b/perf/LuaJIT-benches/pidigits-nogmp.lua @@ -1,3 +1,11 @@ +-- The benchmark to check the performance of arithmetic operations +-- array accesses simulating the multi-precision number +-- operations and the streaming output to the stdout. This +-- benchmark calculates the first numbers of Pi. +-- For the details see: +-- https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/pidigits.html + +local bench = require("bench").new(arg) -- Start of dynamically compiled chunk. local chunk = [=[ @@ -80,21 +88,41 @@ end) ]=] -- End of dynamically compiled chunk. -local N = tonumber(arg and arg[1]) or 27 +local N = tonumber(arg and arg[1]) or 5000 local RADIX = N < 6500 and 2^36 or 2^32 -- Avoid overflow. --- Substitute radix and compile chunk. -local pidigit = loadstring(string.gsub(chunk, "RADIX", tostring(RADIX)))() +local stdout = io.output() --- Print lines with 10 digits. -for i=10,N,10 do - for j=1,10 do io.write(pidigit()) end - io.write("\t:", i, "\n") -end +bench:add({ + name = "pidigit_nogmp", + -- Avoid skip checking here, since it is not very convenient. + -- If you want to check the behaviour -- drop the setup + -- function. + skip_check = true, + setup = function() + io.output("/dev/null") + end, + payload = function() + -- Substitute radix and compile chunk. + local pidigit = loadstring(string.gsub(chunk, "RADIX", tostring(RADIX)))() --- Print remaining digits (if any). -local n10 = N % 10 -if n10 ~= 0 then - for i=1,n10 do io.write(pidigit()) end - io.write(string.rep(" ", 10-n10), "\t:", N, "\n") -end + -- Print lines with 10 digits. + for i = 10, N, 10 do + for _ = 1, 10 do io.write(pidigit()) end + io.write("\t:", i, "\n") + end + + -- Print remaining digits (if any). + local n10 = N % 10 + if n10 ~= 0 then + for _ = 1, n10 do io.write(pidigit()) end + io.write(string.rep(" ", 10 - n10), "\t:", N, "\n") + end + end, + teardown = function() + io.output(stdout) + end, + items = N, +}) + +bench:run_and_report() -- 2.52.0