[Tarantool-patches] [PATCH v2 luajit 04/41] perf: adjust array3d in LuaJIT-benches
Sergey Kaplun
skaplun at tarantool.org
Sat Jan 3 09:20:00 MSK 2026
Hi, Sergey!
Thanks for the review!
Fixed your comments, see the iterative patch below.
On 29.12.25, Sergey Bronnikov wrote:
> Hi, Sergey!
>
> LGTM with a minor comments.
>
> Sergey
>
> On 12/26/25 12:17, Sergey Kaplun wrote:
<snipped>
> > -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.
Fixed, see the iterative patch below.
> > + 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/
Fixed:
===================================================================
diff --git a/perf/LuaJIT-benches/array3d.lua b/perf/LuaJIT-benches/array3d.lua
index 80562706..d41c564e 100644
--- a/perf/LuaJIT-benches/array3d.lua
+++ b/perf/LuaJIT-benches/array3d.lua
@@ -59,13 +59,13 @@ local packed = arg and arg[2] == "packed" -- Packed image or flat
bench:add({
name = "array3d",
checker = function(arr)
- assert(arr.image[dim^3-1] == (dim-1)^2)
+ assert(arr.image[dim ^ 3 - 1] == (dim - 1) ^ 2)
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)
+ arr:set(x, y, z, x * x)
end
return arr
end,
===================================================================
> > + 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()
--
Best regards,
Sergey Kaplun
More information about the Tarantool-patches
mailing list