<!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! SeeĀ my comments.</p>
<p>Sergey</p>
<div class="moz-cite-prefix">On 10/24/25 13:50, Sergey Kaplun wrote:<br>
</div>
<blockquote type="cite"
cite="mid:124c286f2d9d6d9b9ce227e6f2b8f25258208987.1761301736.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/md5.lua | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/perf/LuaJIT-benches/md5.lua b/perf/LuaJIT-benches/md5.lua
index fdf6b4a7..5ec67527 100644
--- a/perf/LuaJIT-benches/md5.lua
+++ b/perf/LuaJIT-benches/md5.lua
@@ -1,5 +1,6 @@
-
local bit = require("bit")
+local bench = require("bench").new(arg)
+
local tobit, tohex, bnot = bit.tobit or bit.cast, bit.tohex, bit.bnot
local bor, band, bxor = bit.bor, bit.band, bit.bxor
local lshift, rshift, rol, bswap = bit.lshift, bit.rshift, bit.rol, bit.bswap
@@ -147,7 +148,7 @@ assert(md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') ==
assert(md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') ==
'57edf4a22be3c955ac49da2e2107b67a')
-local N = tonumber(arg and arg[1]) or 10000
+local N = tonumber(arg and arg[1]) or 20000</pre>
</blockquote>
this deserves a comment, why 20000 instead 10000?
<blockquote type="cite"
cite="mid:124c286f2d9d6d9b9ce227e6f2b8f25258208987.1761301736.git.skaplun@tarantool.org">
<pre wrap="" class="moz-quote-pre">
-- Credits: William Shakespeare, Romeo and Juliet
local txt = [[Rebellious subjects, enemies to peace,
@@ -176,8 +177,20 @@ Once more, on pain of death, all men depart.]]
txt = txt..txt..txt..txt
txt = txt..txt..txt..txt
-for i=1,N do
- res = md5(txt)
-end
-assert(res == 'a831e91e0f70eddcb70dc61c6f82f6cd')
-
+bench:add({
+ name = 'md5',
+ payload = function()
+ local res
+ for i=1,N do</pre>
</blockquote>
s/1,/1, /
<blockquote type="cite"
cite="mid:124c286f2d9d6d9b9ce227e6f2b8f25258208987.1761301736.git.skaplun@tarantool.org">
<pre wrap="" class="moz-quote-pre">
+ res = md5(txt)
+ end
+ return res
+ end,
+ checker = function(res)
+ assert(res == 'a831e91e0f70eddcb70dc61c6f82f6cd')
+ return true
+ end,
+ items = N,
+})
+
+bench:run_and_report()
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>