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 F2968164972D; Fri, 24 Oct 2025 14:10:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F2968164972D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1761304249; bh=lb5zRvVHSLvit3xjKkDnI9rKPyKfuhVvlO3px7x6NZI=; 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=hJHoIOTHRexvRN27pcG8fejJo8Wc6DQYmtwKdpSIlDJvDzxKfgNtDeYyLpmN+vyjQ rsuhQdeDElrUbGkstOCBP3QuNpirCHtE2niJr0/I9EAacs7zo1rBU3aviJ4bHZcUIW I0Y66ovMatAY/DfzY5PxULMCw3nHK0dJJXzdNmzg= Received: from send266.i.mail.ru (send266.i.mail.ru [95.163.59.105]) (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 EB5F215FB901 for ; Fri, 24 Oct 2025 14:00:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EB5F215FB901 Received: by exim-smtp-855f5997bb-lwcs4 with esmtpa (envelope-from ) id 1vCFWu-00000000C1f-0Etg; Fri, 24 Oct 2025 14:00:20 +0300 To: Sergey Bronnikov Date: Fri, 24 Oct 2025 14:00:12 +0300 Message-ID: <5fb7539d5539b29ed416c83a3ec413c5032c99ab.1761301736.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.51.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: 4F1203BC0FB41BD9DAB542EDD08389FE2F1A3EA1D6E5B80E73D8A63FD6AF600F182A05F538085040E660FF2A774FCB723DE06ABAFEAF6705F9E8E6D6D00533A752E7C6720268728E0A58214F65DFC571 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A179494B5629353BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FE9EFE935CD7C6AE8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B23F9911C55E915B702E070BE324C7D3C444DCE815DCCADBCBF6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249B0E9FD5D4288160ECC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0A633E4711A430BBE8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C309A7649CC036878F35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A50EA21A54DEC8BD595002B1117B3ED6967354B50C996BA2EA466072E6821086B3823CB91A9FED034534781492E4B8EEADC3194D76C41E9723C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34753B45383CEFF2047F55BB016B26E6FA10CD604E9BA30E971649AE3A4BFFA11CFBD95EC51C0C071D1D7E09C32AA3244CEF0E47F6E527CFC477DD89D51EBB7742A40EFC534F953219EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVRN2q9QiacRuJKAl7+xWoF8= X-DA7885C5: 08DE24C179F265F6F255D290C0D534F91AB04C92AE4024968EB5CD484D889438EA3D91D35CF3FE525B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD2DC23A718805C55B8D0C875D4A661AC7779AA80E6E3437A42E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 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 | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/perf/LuaJIT-benches/sum-file.lua b/perf/LuaJIT-benches/sum-file.lua index c9e618fd..270c1865 100644 --- a/perf/LuaJIT-benches/sum-file.lua +++ b/perf/LuaJIT-benches/sum-file.lua @@ -1,6 +1,25 @@ +local bench = require("bench").new(arg) -local sum = 0 -for line in io.lines() do - sum = sum + line -end -io.write(sum, "\n") +-- 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.51.0