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 2E88316516AE; Fri, 26 Dec 2025 12:36:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2E88316516AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766741786; bh=pnh72Is5wiMZ+Zysaz2RNLOUbC+7m6upw9J8ygo9q0o=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BIaOyBBbb9ghGup+SKWSrtGxF0m0f5tW+pXJjzQf99Q3xNbAjlt3wGXVq+YIpBDxj jtmHDwT4nkrhHuaq6yMzPzcetILFS6OFhxuWF2ELcb4iPcgt1qbEhdvgCtbaz8bJ3I CxusSUc6UAk6eVBJ4FydHmNXJf30hMKm2QgUnR0g= Received: from send37.i.mail.ru (send37.i.mail.ru [89.221.237.132]) (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 9864716C65A2 for ; Fri, 26 Dec 2025 12:20:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9864716C65A2 Received: by exim-smtp-7b4fb89df9-lft7n with esmtpa (envelope-from ) id 1vZ3zo-000000008Cp-2tE3; Fri, 26 Dec 2025 12:20:29 +0300 To: Sergey Bronnikov Date: Fri, 26 Dec 2025 12:18:07 +0300 Message-ID: <4ab0f949bd2c130a977aa07b4fd08eb845f1442d.1766738771.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD136B1DE29D0A14187F3E33C5CB109B4B182A05F5380850400ABABCB21BBC5B5E3DE06ABAFEAF67055AEF62F05A1BF85DB4FA2C6BBBE99EF9A4391FF724C386E8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE746D93DAA4671895CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F88016AB904663428638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B21CF725520DFEB5152E070BE324C7D3C47D84E83202806AA8F6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249042F1592492B88C6CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C08794E14F7ADDB10D8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C39472471D10B198B935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A56DE83D4BEBF22D7D5002B1117B3ED6966295AA31ECC65F1E03803A57F48E4E5A823CB91A9FED034534781492E4B8EEADA2D5570B22232E1EC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6597A808E7353EBD142623816996D30C6AA34E381793B0E8E5C359A7071F0DF1F8B1C381951A34F52B0B8341EE9D5BE9A0A0618990C6FBC298805D8439B09F6DFF08D02C9172A28E9126536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbzhR6vBeGc1g= X-DA7885C5: 584E721F48E6FD98F255D290C0D534F9DA17101354A98B42C8C211B1EE1A0AE9CBFE1DE576215EF05B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2E190FAFF4CA717688700636FE984EBB8DDF2BC1A5BD391D9E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 36/41] perf: adjust sum-file 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 input for the test is redirected from the generated file . This file is the result of concatenation of the 5000 times. --- perf/LuaJIT-benches/sum-file.lua | 33 +++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/perf/LuaJIT-benches/sum-file.lua b/perf/LuaJIT-benches/sum-file.lua index c9e618fd..6af2b4a5 100644 --- a/perf/LuaJIT-benches/sum-file.lua +++ b/perf/LuaJIT-benches/sum-file.lua @@ -1,6 +1,29 @@ +-- The benchmark to check the performance of reading lines from +-- stdin and sum the given numbers (the strings converted to +-- numbers by the VM automatically). -local sum = 0 -for line in io.lines() do - sum = sum + line -end -io.write(sum, "\n") +local bench = require("bench").new(arg) + +-- XXX: The input file is generated from by +-- repeating it 5000 times. The contains 1000 lines +-- with the total sum of 500. +bench:add({ + name = "sum_file", + payload = function() + local sum = 0 + for line in io.lines() do + sum = sum + line + end + -- Allow several iterations. + io.stdin:seek("set", 0) + return sum + end, + checker = function(res) + -- Precomputed result. + return res == 2500000 + end, + -- Fixed size of the file. + items = 5e6, +}) + +bench:run_and_report() -- 2.52.0