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 D196E169786D; Fri, 26 Dec 2025 11:07:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D196E169786D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766736448; bh=e9VzXJfYarKIHh9H+gvA+4HdTV3aXOULkRFxeAOyhTE=; 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=k/ckciyzX+YpMa+IoXS1hoAqoPwBYBy1gvbHs6BqWPPx0EPP99RPRts+MfujlUWZD HXuSUrMnffVMZaMEKc18NsrlIjIoxjkji1i2XlL5aRfKt3Lyga1giuIYwr/44jV9sB v9zYO4uOs/0cTYDTf8TpItQVD5nocSnsbrmuG0yY= Received: from send103.i.mail.ru (send103.i.mail.ru [89.221.237.198]) (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 C13FE165158A for ; Fri, 26 Dec 2025 11:07:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C13FE165158A Received: by exim-smtp-7b4fb89df9-dq9tr with esmtpa (envelope-from ) id 1vZ2r7-00000000KJk-2NN7; Fri, 26 Dec 2025 11:07:25 +0300 Date: Fri, 26 Dec 2025 11:07:23 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <7bed01339e183b7e57bda18130a61748b332c8d0.1761301736.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD651A111AECFA267DF4E9497E9DD4D3AA182A05F5380850408F0495E84978301E3DE06ABAFEAF670563E826E7198C1A2A4F327FDBBEDA3D81333BECB3000124C7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7227E4400968B082FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C869AF02C76DF4C5BC453B8953496808FD6EF11FF62BD5AA6DE6389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3C9EEE74C166EF7BC35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5083340A12A26DC9F5002B1117B3ED696C8C8DF3D80C547F8C66B2B37046EC955823CB91A9FED034534781492E4B8EEADF5E532225D4D775BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6595204CFA0B1366AD13866420435DC9E1D85B73C2679B7D9A53BAC4E4391728C492389CA9A11025563B8341EE9D5BE9A0A00BC4C795554605AE6267137881E920BE53F2698AA33C2538CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbVENYVbkqjMA= X-DA7885C5: D10E582373949832F255D290C0D534F9109AB8534C477E2DE22BFB7AFE675F6637C151FE512166CE5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2F2263C92A046EA2A687280BA2D041292E37F9BDCA6D732E2E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 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 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 comments below. On 13.11.25, Sergey Bronnikov wrote: > Hi, Sergey! > > thanks for the patch! > > On 10/24/25 13:50, Sergey Kaplun wrote: Also, added the comment with the benchmark description as we discussed offline. =================================================================== diff --git a/perf/LuaJIT-benches/array3d.lua b/perf/LuaJIT-benches/array3d.lua index 1062fff0..4d88432d 100644 --- a/perf/LuaJIT-benches/array3d.lua +++ b/perf/LuaJIT-benches/array3d.lua @@ -1,3 +1,7 @@ +-- 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) =================================================================== > > -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) > > + return true > > + end, > > + payload = function() > > + local arr = array_new(dim, dim, dim, packed) > > + for x,y,z inarr:points() do > please add whitespaces after commas Added: =================================================================== diff --git a/perf/LuaJIT-benches/array3d.lua b/perf/LuaJIT-benches/array3d.lua index 75ab5b01..1062fff0 100644 --- a/perf/LuaJIT-benches/array3d.lua +++ b/perf/LuaJIT-benches/array3d.lua @@ -60,7 +60,7 @@ bench:add({ end, payload = function() local arr = array_new(dim, dim, dim, packed) - for x,y,z in arr:points() do + for x, y, z in arr:points() do arr:set(x, y, z, x*x) end return arr =================================================================== But I'm not sure that we need to refactor each part of the code this way. Anyway, I'm OK with reformatting this since we already touched this chunk. > > +arr:set(x, y, z, x*x) > > + end > > + return arr > > + end, > > + items = dim * dim * dim, > > + -- Limit the number of iterations to avoid OOM errors for > > + -- non-GC64 builds. > > + iterations = 5, Replaced to 4 iterations, since sometimes it strikes the OOM on the runner. =================================================================== diff --git a/perf/LuaJIT-benches/array3d.lua b/perf/LuaJIT-benches/array3d.lua index 4d88432d..80562706 100644 --- a/perf/LuaJIT-benches/array3d.lua +++ b/perf/LuaJIT-benches/array3d.lua @@ -72,7 +72,7 @@ bench:add({ items = dim * dim * dim, -- Limit the number of iterations to avoid OOM errors for -- non-GC64 builds. - iterations = 5, + iterations = 4, }) bench:run_and_report() =================================================================== > > +}) > > > > +bench:run_and_report() > > Looks like benchmark min time does not work as expected: > > [1] ~/sources/MRG/tarantool/third_party/luajit $ time ./build/src/luajit > perf/LuaJIT-benches/array3d.lua --benchmark_min_time=10 > ------------------------------------------------------------------------------------------------------------- > Benchmark                                     Time  CPU    Iterations > UserCounters... > ------------------------------------------------------------------------------------------------------------- > array3d                                     2.10 s          2.13 s      >        5 items_per_second=64.370M/s > > real    0m2.333s > user    0m1.869s > sys     0m0.461s > [1] ~/sources/MRG/tarantool/third_party/luajit $ > > --benchmark_min_time set to 10 sec, but benchmark.lua reports "2.10 s" > and time reported by `time` utility > > is less than 10 sec. It works exactly as expected, since this option is superseded by the `iterations` value in the becnhmark configuration, see the corresponding comment in the code for the rationale in this particular benchmark. Also, it is mentioned in the commit message. -- Best regards, Sergey Kaplun