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 0821316AE24F; Fri, 26 Dec 2025 11:29:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0821316AE24F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766737779; bh=sGNHqgWsfF62kmfquQiCzni4Pn0OpH8dXNf1xp/oJuI=; 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=Ljhb8pmIne5XrGSmaH5wdUScAV+W2fbfTS+WERdYotja8Z1AVtto7l3DawiUzbGlC j1i3hVqVPo+kpOZk1TFUQ5Kg6JatPOTQlOkRoI39CFzCGabZhLRdjVULHQMx7ukNm7 m+6dU40O6Sz2wUIWx8oexCJhsVSjXV5V+qoRbDlo= 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 0CADC16AE246 for ; Fri, 26 Dec 2025 11:29:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0CADC16AE246 Received: by exim-smtp-7b4fb89df9-st9hs with esmtpa (envelope-from ) id 1vZ3Ca-00000000Jwu-1Tx1; Fri, 26 Dec 2025 11:29:37 +0300 Date: Fri, 26 Dec 2025 11:29:34 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <8f29317ee2bd8403e728fb44331293e28693bbfa.1761301736.git.skaplun@tarantool.org> <6464e521-99ca-436a-8662-919386d411b0@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6464e521-99ca-436a-8662-919386d411b0@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD915529E8FC4AA0671BD67E88CAEA01909A7D0956CEC736A9C1867C24CE74E72BB5FE18E9CBFBE7C072549B9692EE52EC3154BCEE23BD470C12AEFC4803097018F467D13D5C6E76B9651CE0648C9E8651D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71BDE6A359BD5B800EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C869667CD0792A1E6A788F88FE94007F68620CD944A7A82F4B76389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3C9EEE74C166EF7BC35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A54184BA51ACCE79365002B1117B3ED696E25D1F0E46D4396EF09842853758E9E5823CB91A9FED034534781492E4B8EEAD4ECBDE8281F904F9BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659D5668D428B7192323D64EFB3185521265A0587723640D3B8384C4F4F76202D3FE57E8FE341686C46B8341EE9D5BE9A0A4FF789AA9DAF5D894B997685A122E359E7CE5193A652A97F8CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbBtlH9EpoNLk= X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD243F2E66BAA77611A39EF5A4942B561A2A246A928513012DEE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 luajit 23/41] perf: adjust ray 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. Fixed your comment and added the short benchmark description as you suggested. On 17.11.25, Sergey Bronnikov wrote: > 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 check the binary output, especially since it may be > > configured by the parameter. > > --- > > perf/LuaJIT-benches/ray.lua | 76 ++++++++++++++++++++++++------------- > > 1 file changed, 50 insertions(+), 26 deletions(-) > > > > diff --git a/perf/LuaJIT-benches/ray.lua b/perf/LuaJIT-benches/ray.lua > > index 2acc24c0..f7b76d0a 100644 > > --- a/perf/LuaJIT-benches/ray.lua > > +++ b/perf/LuaJIT-benches/ray.lua > > @@ -1,10 +1,8 @@ Added the comment with the short benchmark description, as we discussed offline: =================================================================== diff --git a/perf/LuaJIT-benches/ray.lua b/perf/LuaJIT-benches/ray.lua index e9719941..fe31481b 100644 --- a/perf/LuaJIT-benches/ray.lua +++ b/perf/LuaJIT-benches/ray.lua @@ -1,3 +1,7 @@ +-- Benchmark to check the performance of FP arithmetics and +-- structure accesses via modeling of ray tracing. The benchmark +-- generates the fractal image of spheres in the PGM format. + local bench = require("bench").new(arg) local sqrt = math.sqrt =================================================================== > > +local bench = require("bench").new(arg) > > + > > +bench:add({ > > + name = "ray", > > + -- 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() > > + local iss = 1/ss > please add more whitespaces, here and below Fixed: =================================================================== diff --git a/perf/LuaJIT-benches/ray.lua b/perf/LuaJIT-benches/ray.lua index f7b76d0a..e9719941 100644 --- a/perf/LuaJIT-benches/ray.lua +++ b/perf/LuaJIT-benches/ray.lua @@ -121,8 +121,8 @@ bench:add({ io.output("/dev/null") end, payload = function() - local iss = 1/ss - local gf = 255/(ss*ss) + local iss = 1 / ss + local gf = 255 / (ss * ss) delta = 1 while delta * delta + 1 ~= 1 do @@ -137,16 +137,16 @@ bench:add({ local scene = create(level, {0, -1, 0}, 1) - for y = n/2-1, -n/2, -1 do - for x = -n/2, n/2-1 do + for y = n / 2 - 1, -n / 2, -1 do + for x = -n / 2, n / 2 - 1 do local g = 0 - for d = y, y+.99, iss do - for e = x, x+.99, iss do + for d = y, y + .99, iss do + for e = x, x + .99, iss do dir[1], dir[2], dir[3] = unitise(e, d, n) g = g + ray_trace(light, camera, dir, scene) end end - io.write(string.char(math.floor(0.5 + g*gf))) + io.write(string.char(math.floor(0.5 + g * gf))) end end end, =================================================================== > > + local gf = 255/(ss*ss) I've also refactored the benchmark a bit to make it performance match the original version: =================================================================== diff --git a/perf/LuaJIT-benches/ray.lua b/perf/LuaJIT-benches/ray.lua index fe31481b..f322b023 100644 --- a/perf/LuaJIT-benches/ray.lua +++ b/perf/LuaJIT-benches/ray.lua @@ -125,6 +125,9 @@ bench:add({ io.output("/dev/null") end, payload = function() + -- Cache to avoid upvalue lookups. + local level, n, ss = level, n, ss + local iss = 1 / ss local gf = 255 / (ss * ss) =================================================================== -- Best regards, Sergey Kaplun