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 495D3163549C; Thu, 13 Nov 2025 14:11:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 495D3163549C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1763032293; bh=fq0xfu2IdZ9NNUZ23FJNM9BqWvae4qqnG84ncjTYiTc=; 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=Gazo0EYl1FwIQklLnQba3yWDTr7/ZRIIYK4ckKueeYiU8eJhP4g555l6yotfSVfWh QDi1zV1ptIc8O34rddGKLzJ8sc+LL0+rAMp1FV0ES6nXghRx0mEaInGG9K+jgIKs2z Boigodk+y5kBP5mE+AxWxg3ejAtlm2EimAqv9+WM= Received: from send278.i.mail.ru (send278.i.mail.ru [95.163.59.117]) (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 32F2D163549D for ; Thu, 13 Nov 2025 14:11:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 32F2D163549D Received: by exim-smtp-68c8686b96-qkmkn with esmtpa (envelope-from ) id 1vJVEe-000000009tn-3PmU; Thu, 13 Nov 2025 14:11:31 +0300 Content-Type: multipart/alternative; boundary="------------qhfvLMiSyyzze4ei9TXuboJw" Message-ID: Date: Thu, 13 Nov 2025 14:11:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD979CE446CE8475ACDCF9E6C201C025A835F760AE77787C03900894C459B0CD1B9807191070C6EC9915D1BE6A8D71B10A5BC6185E5931FF43879A96A801206A847F82D89A8CF7DB8F5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73B44982FA5E78411EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F88016AB904663428638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2E0B8EEFB209E4CFA2E070BE324C7D3C4940E52219F49E128F6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249D082881546D93491CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0A29E2F051442AF778941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C0CAB4775CB929E3BB7B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F9647ADFADE5905B1F41620B44FB51B7DB3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B779389CF6F126FEC75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5E1C2E8747E2AF9385002B1117B3ED696EC1138F702B4018992212597CCBD6D77823CB91A9FED034534781492E4B8EEAD85CCBA673D36D1A4BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34E229BE567979C94017687AAAA96AEC7967B75341F82D0BF52D48BE8504DDC288EB1A89F23DB824831D7E09C32AA3244CD7CB0B03D9BF160F77DD89D51EBB774236F2B08235B6A0F3EA455F16B58544A2E30DDF7C44BCB90DA5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVfFX+FmbwDW1VV2lVUEmMsE= X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B5976205EA4E99108E13DE06ABAFEAF6705AFC95B4759F2DDE2B7CBEF92542CD7C8795FA72BAB74744FC77752E0C033A69EA16A481184E8BB1C9B38E6EA4F046BE03A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 luajit 06/41] perf: adjust chameneos 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------qhfvLMiSyyzze4ei9TXuboJw Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey! thanks for the patch! LGTM 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/chameneos.lua | 32 ++++++++++++++++++++++--------- > 1 file changed, 23 insertions(+), 9 deletions(-) > > diff --git a/perf/LuaJIT-benches/chameneos.lua b/perf/LuaJIT-benches/chameneos.lua > index 78b64c3f..c1002041 100644 > --- a/perf/LuaJIT-benches/chameneos.lua > +++ b/perf/LuaJIT-benches/chameneos.lua > @@ -1,8 +1,10 @@ > +local bench = require("bench").new(arg) > > local co = coroutine > local create, resume, yield = co.create, co.resume, co.yield > > -local N = tonumber(arg and arg[1]) or 10 > +local N = tonumber(arg and arg[1]) or 1e7 Why 1e7? > +local N_ATTEMPTS = N > local first, second > > -- Meet another creature. > @@ -57,12 +59,24 @@ local function schedule(threads) > until false > end > > --- A bunch of colorful creatures. > -local threads = { > - creature("blue"), > - creature("red"), > - creature("yellow"), > - creature("blue"), > -} > +bench:add({ > + name = "chameneos", > + items = N_ATTEMPTS, > + checker = function(meetings) return meetings == N_ATTEMPTS * 2 end, > + payload = function() > + -- A bunch of colorful creatures. > + local threads = { > + creature("blue"), > + creature("red"), > + creature("yellow"), > + creature("blue"), > + } > > -io.write(schedule(threads), "\n") > + local meetings = schedule(threads) > + -- XXX: Restore meetings for the next iteration. > + N = N_ATTEMPTS > + return meetings > + end, > +}) > + > +bench:run_and_report() --------------qhfvLMiSyyzze4ei9TXuboJw Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey!

thanks for the patch! LGTM

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 <PARAM_x86.txt> file. The arguments to the script still
can be provided in the command line run.
---
 perf/LuaJIT-benches/chameneos.lua | 32 ++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/perf/LuaJIT-benches/chameneos.lua b/perf/LuaJIT-benches/chameneos.lua
index 78b64c3f..c1002041 100644
--- a/perf/LuaJIT-benches/chameneos.lua
+++ b/perf/LuaJIT-benches/chameneos.lua
@@ -1,8 +1,10 @@
+local bench = require("bench").new(arg)
 
 local co = coroutine
 local create, resume, yield = co.create, co.resume, co.yield
 
-local N = tonumber(arg and arg[1]) or 10
+local N = tonumber(arg and arg[1]) or 1e7
Why 1e7?
+local N_ATTEMPTS = N
 local first, second
 
 -- Meet another creature.
@@ -57,12 +59,24 @@ local function schedule(threads)
   until false
 end
 
--- A bunch of colorful creatures.
-local threads = {
-  creature("blue"),
-  creature("red"),
-  creature("yellow"),
-  creature("blue"),
-}
+bench:add({
+  name = "chameneos",
+  items = N_ATTEMPTS,
+  checker = function(meetings) return meetings == N_ATTEMPTS * 2 end,
+  payload = function()
+    -- A bunch of colorful creatures.
+    local threads = {
+      creature("blue"),
+      creature("red"),
+      creature("yellow"),
+      creature("blue"),
+    }
 
-io.write(schedule(threads), "\n")
+    local meetings = schedule(threads)
+    -- XXX: Restore meetings for the next iteration.
+    N = N_ATTEMPTS
+    return meetings
+  end,
+})
+
+bench:run_and_report()
--------------qhfvLMiSyyzze4ei9TXuboJw--