<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<p>Hi, Sergey!</p>
<p>thanks for the patch! LGTM</p>
<p>Sergey</p>
<div class="moz-cite-prefix">On 12/26/25 12:17, Sergey Kaplun wrote:<br>
</div>
<blockquote type="cite"
cite="mid:2eec495f524236decb65267490bb8a2d8f80d727.1766738771.git.skaplun@tarantool.org">
<pre wrap="" class="moz-quote-pre">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:
+-- <a class="moz-txt-link-freetext" href="https://pybenchmarks.org/u64q/performance.php?test=chameneosredux">https://pybenchmarks.org/u64q/performance.php?test=chameneosredux</a>
+-- <a class="moz-txt-link-freetext" href="https://cedric.cnam.fr/PUBLIS/RC474.pdf">https://cedric.cnam.fr/PUBLIS/RC474.pdf</a>
+
+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()
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>