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 7FFC215DEA93; Mon, 17 Nov 2025 16:26:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7FFC215DEA93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1763386002; bh=JNozOg0jwFLjjieLd0aPZKSIS8vJETRxUQHsBzL9AvM=; 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=JbcLPp1d4zJJLygk1Uysd2RRFeG1uDjhXCJAWZDTodidBfGJqnwT9O8yTn3b/hdLn MV+3T9s9JFQe4wdZH3dETTNOXIFwxwcCKM8fClRgtHh2ljPWjwVayDtmSiqNbHkdWR 5YLtZ66GPUTaRDFzpj3N3gAyqm+rAksKZOdhuTpY= Received: from send241.i.mail.ru (send241.i.mail.ru [95.163.59.80]) (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 41F9615B787F for ; Mon, 17 Nov 2025 16:25:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 41F9615B787F Received: by exim-smtp-77df68b9cf-k4thg with esmtpa (envelope-from ) id 1vKzEr-00000000Aek-1MzQ; Mon, 17 Nov 2025 16:25:49 +0300 Content-Type: multipart/alternative; boundary="------------ddfr0B9eIbq5J0tzqgXcbF92" Message-ID: <095b569a-72d0-4437-a6a6-d15e68ae71c6@tarantool.org> Date: Mon, 17 Nov 2025 16:25:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9110BAFCBE6BD1D1638C0B25128CE808CCB9265028675342F182A05F53808504052B4014CBF5E4A333DE06ABAFEAF670553E6C5E3780178C33C1CBB97E487F8EE7A8D2FC48B25BB6B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE704BA85F3D5A9F85BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566D0BE23D09F2BEA50FF822695D46684A5408A415DC94CB97D66F08E7D815D9022389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C05BA2E4CC9113A6267B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F9647ADFADE5905B145B9AC499A3C791CB3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BC6A536F79815AD9275ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A56E819F813E5C0B3D5002B1117B3ED6966ADEBA4CAE2FBD73B74D9144D44E4FCF823CB91A9FED034534781492E4B8EEAD69BF13FED57427F1BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF02A65E1968EF5697E607DEDED1F9B7AD200E2F86483EAA54EFA84DED465C9D20E4A5F4FEF661E8B5DD12B02666E49356683634F86B57232FE17169D636A2256930BE3295B3F5821E111DC66A97D0BFE2913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVfFX+FmbwDW1jPduI5IwXGI= X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B598DCDBB6A5AC91DA83DE06ABAFEAF670553E6C5E3780178C3B7CBEF92542CD7C8795FA72BAB74744FC77752E0C033A69EA16A481184E8BB1C9B38E6EA4F046BE03A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------ddfr0B9eIbq5J0tzqgXcbF92 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey, 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 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 | 49 ++++++++++++++++++-------- > 1 file changed, 35 insertions(+), 14 deletions(-) > > diff --git a/perf/LuaJIT-benches/pidigits-nogmp.lua b/perf/LuaJIT-benches/pidigits-nogmp.lua > index 63a1cb0e..e96b3e45 100644 > --- a/perf/LuaJIT-benches/pidigits-nogmp.lua > +++ b/perf/LuaJIT-benches/pidigits-nogmp.lua > @@ -1,3 +1,4 @@ > +local bench = require("bench").new(arg) > > -- Start of dynamically compiled chunk. > local chunk = [=[ > @@ -80,21 +81,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 Why 5000 by default? > 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 add more whitespaces, here and below > - io.write(string.rep(" ", 10-n10), "\t:", N, "\n") > -end > + -- 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 > + > + -- 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 > + end, > + teardown = function() > + io.output(stdout) > + end, > + items = N, > +}) > + > +bench:run_and_report() --------------ddfr0B9eIbq5J0tzqgXcbF92 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey,

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 default arguments are adjusted
according to the <PARAM_x86.txt> 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 | 49 ++++++++++++++++++--------
 1 file changed, 35 insertions(+), 14 deletions(-)

diff --git a/perf/LuaJIT-benches/pidigits-nogmp.lua b/perf/LuaJIT-benches/pidigits-nogmp.lua
index 63a1cb0e..e96b3e45 100644
--- a/perf/LuaJIT-benches/pidigits-nogmp.lua
+++ b/perf/LuaJIT-benches/pidigits-nogmp.lua
@@ -1,3 +1,4 @@
+local bench = require("bench").new(arg)
 
 -- Start of dynamically compiled chunk.
 local chunk = [=[
@@ -80,21 +81,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
Why 5000 by default?
 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
add more whitespaces, here and below
-  io.write(string.rep(" ", 10-n10), "\t:", N, "\n")
-end
+    -- 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
+
+    -- 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
+  end,
+  teardown = function()
+    io.output(stdout)
+  end,
+  items = N,
+})
+
+bench:run_and_report()
--------------ddfr0B9eIbq5J0tzqgXcbF92--