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 B749B16ADB8B; Fri, 26 Dec 2025 11:37:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B749B16ADB8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766738259; bh=rBUmW5G740vU1ZjLS9pK5WHjXEz2wsbtKoTDeCALDHo=; 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=olb2/skUGFmk1x/hQqlrx9zb5v5aoqCSLjbx6LtZLiA5HXu/m9C2ziAKbqWQ3J22o QU2E6sqR8ISdbv49H790HwtQtEkeUu0XV0rv1ElQA7aFn+qdQIy0MkzqNGCxmQwhfv HcaMnX5N7l3YP/4hygRrKGLkO/8jDDOKTF024dcY= Received: from send83.i.mail.ru (send83.i.mail.ru [89.221.237.178]) (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 A6BB616ADBA6 for ; Fri, 26 Dec 2025 11:37:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A6BB616ADBA6 Received: by exim-smtp-7b4fb89df9-trf4b with esmtpa (envelope-from ) id 1vZ3K8-000000001TV-17MX; Fri, 26 Dec 2025 11:37:24 +0300 Date: Fri, 26 Dec 2025 11:37:22 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <800b8e4d42b3d8f51ad2a5686799004b09e0e719.1761301736.git.skaplun@tarantool.org> <6d0b92fa-a3b7-4a12-b4e8-41faf06e7740@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6d0b92fa-a3b7-4a12-b4e8-41faf06e7740@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBDBD402C266276CBAD49C55E60069EDAD4182A05F5380850402F6217139BADE2573DE06ABAFEAF6705B1B561BD07A29A6095925BE4019C999496A23FDDE6D060B7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE711269A7C2F827F16EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C869AE20BDE51021BC8C1C0B6F5F12C942D5B7B58610CFA3A233389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6957A4DEDD2346B42CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE79E9721B410A3B6ED731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A51B8158DC420A6B545002B1117B3ED6966FB4F80E2C87A8C0886DC9BC01168B20823CB91A9FED034534781492E4B8EEADF5E532225D4D775BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659D762E6D5CFEC631925E0E9E4A66337D6E5945395D1BA3D0922406E553F97AF04905A11293B8505FFB8341EE9D5BE9A0AD8E1E35A67EAA81C8ACF129BE6BD4407AA07CF84472F04718CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbSRlqzCWTue4= X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD25137AFB6A0BAE841EBFC68E18AB3A11FC5A503DC41B936EDE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 luajit 35/41] perf: adjust spectral-norm 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review. Please, consider my answers below. On 17.11.25, Sergey Bronnikov wrote: > Hi, Sergey, > >  thanks for the patch! See my comments below. > > Sergey > > On 10/24/25 14:00, 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. > > --- > > perf/LuaJIT-benches/spectral-norm.lua | 40 +++++++++++++++++++-------- > > 1 file changed, 29 insertions(+), 11 deletions(-) > > > > diff --git a/perf/LuaJIT-benches/spectral-norm.lua b/perf/LuaJIT-benches/spectral-norm.lua > > index ecc80112..6e63cd47 100644 > > --- a/perf/LuaJIT-benches/spectral-norm.lua > > +++ b/perf/LuaJIT-benches/spectral-norm.lua Added the comment with the short benchmark description, as we discussed offline: =================================================================== diff --git a/perf/LuaJIT-benches/spectral-norm.lua b/perf/LuaJIT-benches/spectral-norm.lua index ae0a6b6d..7a7712a0 100644 --- a/perf/LuaJIT-benches/spectral-norm.lua +++ b/perf/LuaJIT-benches/spectral-norm.lua @@ -1,3 +1,10 @@ +-- The benchmark to check the performance of FP arithmetics and +-- function call inlining in the inner loops. +-- The benchmark calculates the spectral norm of an infinite +-- matrix. +-- For more details see: +-- https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/spectralnorm.html + local bench = require("bench").new(arg) local function A(i, j) =================================================================== > > @@ -1,3 +1,4 @@ > > +local bench = require("bench").new(arg) > > > > local function A(i, j) > > local ij = i+j-1 > > @@ -25,16 +26,33 @@ local function AtAv(x, y, t, N) > > Atv(t, y, N) > > end > > > > -local N = tonumber(arg and arg[1]) or 100 > > -local u, v, t = {}, {}, {} > > -for i=1,N do u[i] = 1 end > > +local N = tonumber(arg and arg[1]) or 3000 > Why it was changed to 3000? It is the default for x86 arch. I've taken the values from PARAMS_x86, since this is the most important architecture for the Tarantool, see the commit message. > > > > -for i=1,10 do AtAv(u, v, t, N) AtAv(v, u, t, N) end > > +bench:add({ > > + name = "spectral_norm", > > + checker = function(res) > > + -- XXX: Empirical value. > > + if N > 66 then > > + assert(math.abs(res - 1.27422) < 0.00001) > > + end > > + return true > > + end, > > + payload = function() > > + local u, v, t = {}, {}, {} > > + for i=1,N do u[i] = 1 end > add more whitespaces, here and below Added: =================================================================== diff --git a/perf/LuaJIT-benches/spectral-norm.lua b/perf/LuaJIT-benches/spectral-norm.lua index 6e63cd47..ae0a6b6d 100644 --- a/perf/LuaJIT-benches/spectral-norm.lua +++ b/perf/LuaJIT-benches/spectral-norm.lua @@ -39,15 +39,15 @@ bench:add({ end, payload = function() local u, v, t = {}, {}, {} - for i=1,N do u[i] = 1 end + for i = 1, N do u[i] = 1 end - for i=1,10 do AtAv(u, v, t, N) AtAv(v, u, t, N) end + for _ = 1, 10 do AtAv(u, v, t, N) AtAv(v, u, t, N) end local vBv, vv = 0, 0 - for i=1,N do + for i = 1, N do local ui, vi = u[i], v[i] - vBv = vBv + ui*vi - vv = vv + vi*vi + vBv = vBv + ui * vi + vv = vv + vi * vi end return math.sqrt(vBv / vv) end, =================================================================== -- Best regards, Sergey Kaplun