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 E5FBE16C65B1; Fri, 26 Dec 2025 12:21:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E5FBE16C65B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766740882; bh=csewjofkqPrZ4SwvWsxUGVQXMo447IlgcVfaiBp9ePc=; 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=SVue876h9riCffm4zR/kyV19n6dTQyx4BvFj/Js7j5CPB50W7m4PKvx4SWthqADah lJ3mmdKNkM8VOoy8oTRX3+F8+G73i60Lxzac3VtRWi5qtsRo97wyxh1LI+qjyZrsbL fAgYzc9YkzSDppWVFOrMTDt5je8BfQOMj/zXMIDg= Received: from send82.i.mail.ru (send82.i.mail.ru [89.221.237.177]) (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 3CA3F16C6580 for ; Fri, 26 Dec 2025 12:18:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3CA3F16C6580 Received: by exim-smtp-7b4fb89df9-lft7n with esmtpa (envelope-from ) id 1vZ3xp-000000008Cp-0JUa; Fri, 26 Dec 2025 12:18:25 +0300 To: Sergey Bronnikov Date: Fri, 26 Dec 2025 12:17:37 +0300 Message-ID: <2eec495f524236decb65267490bb8a2d8f80d727.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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD74B261A13C49CF1ECC4C442725D8AB97182A05F538085040A8C3EF67CAC5A80D3DE06ABAFEAF67051888C2538D5C0050B4FA2C6BBBE99EF947030CE06FC90E99 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A8325FA649D0A450EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371D5B197C6EC5B4BE8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2BF7A1A2E6AE53FD52E070BE324C7D3C49D5EBA7DE4342EBFF6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249E232F00D8D26902CA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6D0C9BB9AE6BD5D69089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5D0AE2D3075690B3A5002B1117B3ED69617C713E74ACAF8AB250A03108B67251B823CB91A9FED034534781492E4B8EEAD6804EF05EF4ADF2AF36E2E0160E5C55395B8A2A0B6518DF68C46860778A80D548E8926FB43031F38 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D65945E728DC6EB6376C24C2367E0F3D18221CB6A4EFB500C5279755BC1F4B9E3C2D9A9CAFEC3DCDD159B8341EE9D5BE9A0AF88A7F734AAF791B05D8439B09F6DFF0993904353B1D0F0C6536EB022892E5344C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbQiWjnikaMtQ= X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD22DA338358DEA1E288700636FE984EBB80AEFE5B0843BBDCCE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [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 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. --- 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() -- 2.52.0