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 58E2D167922D; Fri, 26 Dec 2025 11:25:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 58E2D167922D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766737525; bh=gtFTlRjNqhOSFfWfoCi9vO6fAo3PckVMBksFMvkxgrA=; 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=LWKkfJnCrvo84p7p0pFuOdqJih3N4Hnlsl/ERhgYxLky3crG1mLgoTcweGCoCl9gT aKAX7u8Hn3Rlj6BJnPXL/w86RpzuX7AhM0IBIFMIPoQi2kV2zIyWoGYVEhcSMZIBNE QzsS3rDK4RUCYJO6AD8gF4XrGThl7yVZCRgACZcM= Received: from send242.i.mail.ru (send242.i.mail.ru [95.163.59.81]) (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 68B0F1679214 for ; Fri, 26 Dec 2025 11:25:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 68B0F1679214 Received: by exim-smtp-7b4fb89df9-sc9xn with esmtpa (envelope-from ) id 1vZ38V-000000009Ny-1C8y; Fri, 26 Dec 2025 11:25:23 +0300 Date: Fri, 26 Dec 2025 11:25:20 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <3f2714c31979df69479b64c21453442e7d0539db.1761301736.git.skaplun@tarantool.org> <12bc2ee6-c501-4892-a650-047ba1427837@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12bc2ee6-c501-4892-a650-047ba1427837@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD705C26DA7DFA1BE5FABF32B159CC9D93182A05F538085040BD715DC25FEFDC523DE06ABAFEAF6705E91056713B1C22A5C3CE4153D521EAFE6DD001A71ABC03EA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB7B102DCB413779EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C86953BE084790E3F981214CB83EC899B86FED5091BF3BB94036389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D082881546D93491CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE778B471BB9634AD8A731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A503451FA07E6DFD445002B1117B3ED696A60B88DDAEE59FB3715D9AB585B0EB04823CB91A9FED034534781492E4B8EEAD0D89974173551D4FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659521F497581BE4B8310E221E13F6AF0DCE141C125E46046804A6525653D11E03826CEFDCA41F9D1C7B8341EE9D5BE9A0A0D578268AAF957379D88C40F3F7E7D281668E268F72B62FA8CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbv4D6q4o0MWA= X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD213EF0CC5ACB9B597B754EAAA5395A8606981AE318418C2C4E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 luajit 18/41] perf: adjust nsieve-bit-fp 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. See my answers below. 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. > > --- > > perf/LuaJIT-benches/nsieve-bit-fp.lua | 35 +++++++++++++++++++++++---- > > 1 file changed, 30 insertions(+), 5 deletions(-) > > > > diff --git a/perf/LuaJIT-benches/nsieve-bit-fp.lua b/perf/LuaJIT-benches/nsieve-bit-fp.lua > > index 3971ec1f..d0ab23d2 100644 > > --- a/perf/LuaJIT-benches/nsieve-bit-fp.lua > > +++ b/perf/LuaJIT-benches/nsieve-bit-fp.lua > > @@ -1,3 +1,4 @@ Added the comment with the short benchmark description, as we discussed offline: =================================================================== diff --git a/perf/LuaJIT-benches/nsieve-bit-fp.lua b/perf/LuaJIT-benches/nsieve-bit-fp.lua index 9d958950..8ad85dc9 100644 --- a/perf/LuaJIT-benches/nsieve-bit-fp.lua +++ b/perf/LuaJIT-benches/nsieve-bit-fp.lua @@ -1,3 +1,10 @@ +-- Benchmark to check the performance of FP arithmetics and +-- access to the array structure. This benchmark finds all prime +-- numbers in a given segment. This is the FP benchmark that +-- models the bit variation behaviour. +-- For the details see: +-- https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes + local bench = require("bench").new(arg) local floor, ceil = math.floor, math.ceil =================================================================== > > +local bench = require("bench").new(arg) > > > > local floor, ceil = math.floor, math.ceil > > > > @@ -27,11 +28,35 @@ local function nsieve(p, m) > > return count > > end > > > > -local N = tonumber(arg and arg[1]) or 1 > > +local DEFAULT_N = 12 > Why 12 instead of 1? 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. > > +local N = tonumber(arg and arg[1]) or DEFAULT_N > > if N < 2 then N = 2 end > > local primes = {} > > > > -for i=0,2 do > > - local m = (2^(N-i))*10000 > > - io.write(string.format("Primes up to %8d %8d\n", m, nsieve(primes, m))) > > -end > > +local benchmark > > +benchmark = { > > + name = "nsieve_bit_fp", > > + payload = function() > > + local res = {} > > + local items = 0 > > + for i=0,2 do > add more whitespaces > > + local m = (2^(N-i))*10000 > add more whitespaces Fixed: =================================================================== diff --git a/perf/LuaJIT-benches/nsieve-bit-fp.lua b/perf/LuaJIT-benches/nsieve-bit-fp.lua index d0ab23d2..9d958950 100644 --- a/perf/LuaJIT-benches/nsieve-bit-fp.lua +++ b/perf/LuaJIT-benches/nsieve-bit-fp.lua @@ -39,8 +39,8 @@ benchmark = { payload = function() local res = {} local items = 0 - for i=0,2 do - local m = (2^(N-i))*10000 + for i = 0, 2 do + local m = (2 ^ (N - i)) * 10000 items = items + m res[i] = nsieve(primes, m) end =================================================================== > > + items = items + m -- Best regards, Sergey Kaplun