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 71FBA16C02B6; Mon, 29 Dec 2025 17:00:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 71FBA16C02B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1767016833; bh=zSirAXCn3VvO2OsAb8P4pbBHFmOMQh87/FPQ7JWZKvw=; 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=Q49zPSuQDL5hP/oR6TC0XuoW/MEYVIOg8FK4AbODKS6QRJ2JXzK1ggiqRK6ToC7Fq lNGMWYJkQwJwdOmC4K8bPRVcofEx/7e6OgHZ7OBRiIpgOUXpabHRA31utDyaJ6p8JY uuuw7O6T0eo3jM2t6YA5U2WNl7Y+sul9PhQSdDmk= 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 DAE4216C02B8 for ; Mon, 29 Dec 2025 17:00:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DAE4216C02B8 Received: by exim-smtp-7b4fb89df9-bfn9g with esmtpa (envelope-from ) id 1vaDnS-000000002YL-3lNE; Mon, 29 Dec 2025 17:00:31 +0300 Content-Type: multipart/alternative; boundary="------------K63xnyaAdLIZ9hWkKJ00z9gB" Message-ID: <6ad35db1-a272-4000-8c08-1b47a04716b7@tarantool.org> Date: Mon, 29 Dec 2025 17:00:30 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <137994c89849daa406bc9140cf4d96f5b632e70d.1766738771.git.skaplun@tarantool.org> In-Reply-To: <137994c89849daa406bc9140cf4d96f5b632e70d.1766738771.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD5FB5867E87496E3ED186ABB0F1A32B63182A05F538085040E2D7E7B30E677D0B3DE06ABAFEAF6705939A4CD1BEF9A9C9DBBE890456306557C6DF27F5819425CF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BCC85671EC7A750CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637ECAF4C2CEE0D0B2F8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2A9AEB63DBC0179332E070BE324C7D3C44B9A930F69EED9CAF6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249D082881546D93491CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0A29E2F051442AF778941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C0CAB4775CB929E3BB7B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F9647ADFADE5905B1F41620B44FB51B7DB3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B569F1129A2C6445075ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5CA52BE8A797796FC5002B1117B3ED696B56CA05B3421B5F8E772F934B9BCD185823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659200CDF8BF26F3C9588AC8DFE08DE042F621F91563CE968539B4EA41D3FC57371DE12E91DD4EC4301B8341EE9D5BE9A0A4CB3F7E15CE85CBE008004674E0BF32A24809A5F7BC44FBB8CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVTZJppT4ZVHR4V7DSyJu32Y= X-Mailru-Sender: 811C44EDE0507D1FF7A5115BD94F8393B63ACBD828F0979500C2CDE4AB6CFA7B963A04219A2848CC3B0BF030481DD0BC645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 04/41] perf: adjust array3d 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. --------------K63xnyaAdLIZ9hWkKJ00z9gB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey! LGTM with a minor comments. 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 number of iterations is fixed for this test to avoid OOM errors > for the non-GC64 builds. > --- > perf/LuaJIT-benches/array3d.lua | 29 ++++++++++++++++++++++++----- > 1 file changed, 24 insertions(+), 5 deletions(-) > > diff --git a/perf/LuaJIT-benches/array3d.lua b/perf/LuaJIT-benches/array3d.lua > index c10b09b1..80562706 100644 > --- a/perf/LuaJIT-benches/array3d.lua > +++ b/perf/LuaJIT-benches/array3d.lua > @@ -1,3 +1,8 @@ > +-- The benchmark to measure simple operations on array-like data > +-- structures. > +-- Here, a 3D array is represented as a contiguous 1D array. > + > +local bench = require("bench").new(arg) > > local function array_set(self, x, y, z, p) > assert(x >= 0 and x < self.nx, "x outside PA") > @@ -50,10 +55,24 @@ end > > local dim = tonumber(arg and arg[1]) or 300 -- Array dimension dim^3 > local packed = arg and arg[2] == "packed" -- Packed image or flat > -local arr = array_new(dim, dim, dim, packed) > > -for x,y,z inarr:points() do > -arr:set(x, y, z, x*x) > -end > -assert(arr.image[dim^3-1] == (dim-1)^2) > +bench:add({ > + name = "array3d", > + checker = function(arr) > + assert(arr.image[dim^3-1] == (dim-1)^2) Please add more whitespaces. > + return true > + end, > + payload = function() > + local arr = array_new(dim, dim, dim, packed) > + for x, y, z inarr:points() do > +arr:set(x, y, z, x*x) s/x*x/x * x/ > + end > + return arr > + end, > + items = dim * dim * dim, > + -- Limit the number of iterations to avoid OOM errors for > + -- non-GC64 builds. > + iterations = 4, > +}) > > +bench:run_and_report() --------------K63xnyaAdLIZ9hWkKJ00z9gB Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey!

LGTM with a minor comments.

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 number of iterations is fixed for this test to avoid OOM errors
for the non-GC64 builds.
---
 perf/LuaJIT-benches/array3d.lua | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/perf/LuaJIT-benches/array3d.lua b/perf/LuaJIT-benches/array3d.lua
index c10b09b1..80562706 100644
--- a/perf/LuaJIT-benches/array3d.lua
+++ b/perf/LuaJIT-benches/array3d.lua
@@ -1,3 +1,8 @@
+-- The benchmark to measure simple operations on array-like data
+-- structures.
+-- Here, a 3D array is represented as a contiguous 1D array.
+
+local bench = require("bench").new(arg)
 
 local function array_set(self, x, y, z, p)
   assert(x >= 0 and x < self.nx, "x outside PA")
@@ -50,10 +55,24 @@ end
 
 local dim = tonumber(arg and arg[1]) or 300 -- Array dimension dim^3
 local packed = arg and arg[2] == "packed"   -- Packed image or flat
-local arr = array_new(dim, dim, dim, packed)
 
-for x,y,z in arr:points() do
-  arr:set(x, y, z, x*x)
-end
-assert(arr.image[dim^3-1] == (dim-1)^2)
+bench:add({
+  name = "array3d",
+  checker = function(arr)
+    assert(arr.image[dim^3-1] == (dim-1)^2)
Please add more whitespaces.
+    return true
+  end,
+  payload = function()
+    local arr = array_new(dim, dim, dim, packed)
+    for x, y, z in arr:points() do
+      arr:set(x, y, z, x*x)
s/x*x/x * x/
+    end
+    return arr
+  end,
+  items = dim * dim * dim,
+  -- Limit the number of iterations to avoid OOM errors for
+  -- non-GC64 builds.
+  iterations = 4,
+})
 
+bench:run_and_report()
--------------K63xnyaAdLIZ9hWkKJ00z9gB--