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 2824516D4564; Fri, 2 Jan 2026 14:07:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2824516D4564 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1767352039; bh=wxjiulyGJyGUtD11zcvi8jJpD8GCiHvFVjSohn/Ay/0=; 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=zgl+XTYdbs6axDENWa3m4YT+M7jCypC1IRrxy5sQD8jznFrFVWKA5W69oY/eu2JsF iIq9FiNMijN1PHOh4m516HGfbUy6M7CCDI9RwSz+B11sL5K/OVNPSp2ldpvG2kyc+1 jjvyrSUULNTecoeJd1V/NhZwuvyKmDYt5e4DE374= Received: from send277.i.mail.ru (send277.i.mail.ru [95.163.59.116]) (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 A01AF16D4558 for ; Fri, 2 Jan 2026 14:07:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A01AF16D4558 Received: by exim-smtp-7b4fb89df9-ll72k with esmtpa (envelope-from ) id 1vbd00-000000001mZ-2ZnI; Fri, 02 Jan 2026 14:07:16 +0300 Content-Type: multipart/alternative; boundary="------------u0jrjy6qqbh1arQ7JZGI0zwS" Message-ID: <7dee9433-5a74-4f13-a5fc-4ab57cc4bb32@tarantool.org> Date: Fri, 2 Jan 2026 14:07:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <7554bb7b0bed0d3aaae0179b523b970f70c04e3a.1766738771.git.skaplun@tarantool.org> In-Reply-To: <7554bb7b0bed0d3aaae0179b523b970f70c04e3a.1766738771.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD915529E8FC4AA0671CA1E07C573811262D4DDCA1B9C9DBAFD1867C24CE74E72BB5FE18E9CBFBE7C07D02EA913339B6BE274D848876F8BA39539F7FF7C88C5E5DEF9A2A15EBCEBACA3C5C7FD16981B76AE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE700B5EAEB6F2DE1BDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566D1B0EEF93386A5FD7EBBD6D74039C86BB3B2CB51E923727BDC1C6C8F59B2A4D7389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249E473A0F43A664A8D76E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B8D91A52B72CA83B53AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7352629B07FD02F83A6C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5FA688397961A5C5D5002B1117B3ED6967C5CB4319FE98F5AA13BD6A4B0E00B96823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659B98CF87A39886714153270F6B462CD8133E3D503D3AC445F87EF1524AC9553E4C077E1DA0153AB7AB8341EE9D5BE9A0AEEA9B786CFC8A18715D1653FBED1FDB70FA02F17984CB1DF8CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVTZJppT4ZVHRcdOFW18firg= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884581445E8AD1D5E4261F6A6F50B1491C03577D0CE1341193AD3EA2B700F1110B6AD645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [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 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. --------------u0jrjy6qqbh1arQ7JZGI0zwS Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey! thanks for the patch! LGTM Sergey On 12/26/25 12:17, 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 | 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() --------------u0jrjy6qqbh1arQ7JZGI0zwS Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey!

thanks for the patch! LGTM

Sergey

On 12/26/25 12:17, 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 | 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()
--------------u0jrjy6qqbh1arQ7JZGI0zwS--