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 F253A16744F0; Mon, 29 Dec 2025 17:18:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F253A16744F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1767017919; bh=45byvqdgR2H+VjnEkK3QnKQcGmzfzll0wzvS2C3IZlQ=; 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=NUqHkBxynKtC8PjbDlrIwwAwNGDtOT4UbABltl3IYl4kr3HtNnjX1YpPdanPq7YM1 5oJ0+9pNdijD1QzAPPKNNNy4v3fuAW7CAkdt/AMaH4YD27f+L1CZq4lKJ1scq5rJGw H/gC8H4axNBIo3Xs0apZ2HtnGJqWvDw4P0iCGZnw= Received: from send83.i.mail.ru (send83.i.mail.ru [89.221.237.178]) (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 F140716744E7 for ; Mon, 29 Dec 2025 17:18:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F140716744E7 Received: by exim-smtp-7b4fb89df9-449cf with esmtpa (envelope-from ) id 1vaE4z-00000000MD5-09nk; Mon, 29 Dec 2025 17:18:37 +0300 Content-Type: multipart/alternative; boundary="------------wrh0zuUfFvrwoCTD2a1yWPNu" Message-ID: Date: Mon, 29 Dec 2025 17:18:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <2eec495f524236decb65267490bb8a2d8f80d727.1766738771.git.skaplun@tarantool.org> In-Reply-To: <2eec495f524236decb65267490bb8a2d8f80d727.1766738771.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD915529E8FC4AA0671BD67E88CAEA01909A7D0956CEC736A9C1867C24CE74E72BB5FE18E9CBFBE7C0726F81D193E61B2C360AA62478CF4B5FB95FC9CA37EF17A859548DCB3B3EF554D51CE0648C9E8651D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F65C230EDDCD559EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371D5B197C6EC5B4BE8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2BA85E83F95C10FB62E070BE324C7D3C4093B3394685E25FDF6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249D082881546D93491CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0A3E989B1926288338941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C046858BEBD2CECBDC7B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F9647ADFADE5905B14AAC223A686B1DECB3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9149C560DC76099D75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A52F702CFF11F074A45002B1117B3ED6967B23FFB808A07D6092B673A2F5DDD7E7823CB91A9FED034534781492E4B8EEADCAFEFF123806BC82BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6597B0F37B03F36A3437F7B4A8A29E8673881BCE853149D1E6AE586B4D0728C3FC78D34D2BC7E1435ECB8341EE9D5BE9A0A11574611131CA79197A478FE23C5E74D9EB6A71505B5755A8CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVTZJppT4ZVHRHVkmv0Le0x4= X-Mailru-Sender: 811C44EDE0507D1FF7A5115BD94F8393C2DCA28A0678CEBD04DE63E6493D4605CD8184E90347C9BAF4FC6B3A553790D5645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 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. --------------wrh0zuUfFvrwoCTD2a1yWPNu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey! thanks for the patch! LGTM Sergey On 12/26/25 12:17, 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 | 38 +++++++++++++++++++++++-------- > 1 file changed, 29 insertions(+), 9 deletions(-) > > diff --git a/perf/LuaJIT-benches/chameneos.lua b/perf/LuaJIT-benches/chameneos.lua > index 78b64c3f..9bd83081 100644 > --- a/perf/LuaJIT-benches/chameneos.lua > +++ b/perf/LuaJIT-benches/chameneos.lua > @@ -1,8 +1,16 @@ > +-- The benchmark to check the performance of coroutine interaction > +-- using symmetrical rendezvous requests. > +-- For the details see: > +--https://pybenchmarks.org/u64q/performance.php?test=chameneosredux > +--https://cedric.cnam.fr/PUBLIS/RC474.pdf > + > +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 > +local N_ATTEMPTS = N > local first, second > > -- Meet another creature. > @@ -57,12 +65,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"), > + } > + > + local meetings = schedule(threads) > + -- XXX: Restore meetings for the next iteration. > + N = N_ATTEMPTS > + return meetings > + end, > +}) > > -io.write(schedule(threads), "\n") > +bench:run_and_report() --------------wrh0zuUfFvrwoCTD2a1yWPNu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey!

thanks for the patch! LGTM

Sergey

On 12/26/25 12:17, 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 | 38 +++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/perf/LuaJIT-benches/chameneos.lua b/perf/LuaJIT-benches/chameneos.lua
index 78b64c3f..9bd83081 100644
--- a/perf/LuaJIT-benches/chameneos.lua
+++ b/perf/LuaJIT-benches/chameneos.lua
@@ -1,8 +1,16 @@
+-- The benchmark to check the performance of coroutine interaction
+-- using symmetrical rendezvous requests.
+-- For the details see:
+-- https://pybenchmarks.org/u64q/performance.php?test=chameneosredux
+-- https://cedric.cnam.fr/PUBLIS/RC474.pdf
+
+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
+local N_ATTEMPTS = N
 local first, second
 
 -- Meet another creature.
@@ -57,12 +65,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"),
+    }
+
+    local meetings = schedule(threads)
+    -- XXX: Restore meetings for the next iteration.
+    N = N_ATTEMPTS
+    return meetings
+  end,
+})
 
-io.write(schedule(threads), "\n")
+bench:run_and_report()
--------------wrh0zuUfFvrwoCTD2a1yWPNu--