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 0935C169B682; Fri, 2 Jan 2026 13:15:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0935C169B682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1767348911; bh=WVvChn4+dWUMSZ+eiZjNS5IV494K4zRgYPp119ejEwc=; 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=GKTlLPl8FUuDMG5qSoHnxiUgRJQlpis5DVc0PMvLKeuDV3YOBb6KzEns7X+ylFyl8 7J18XOdovhvF9nH6yKnmKBIxyMvAJFI3qtZnMd6GpuGIN4SdvF6EMQQZNTmMSVrRBv QvI814IvLF2X4lGEWbcA95LtOp8l47uBJzS3rl64= 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 ED23E169B680 for ; Fri, 2 Jan 2026 13:15:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ED23E169B680 Received: by exim-smtp-7b4fb89df9-pmfc6 with esmtpa (envelope-from ) id 1vbcBY-00000000SAv-3TXl; Fri, 02 Jan 2026 13:15:09 +0300 Content-Type: multipart/alternative; boundary="------------nsCOiazv5JU5Q0Urpcqjf4t0" Message-ID: <089864b0-3bcf-4e6c-8055-5dea6fc6a75a@tarantool.org> Date: Fri, 2 Jan 2026 13:15:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <005865a6e0b5765b4d94c82fbd37e542ac36ac3f.1766738771.git.skaplun@tarantool.org> In-Reply-To: <005865a6e0b5765b4d94c82fbd37e542ac36ac3f.1766738771.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBD78E5B51DE69E67E134CC12E14949938B182A05F538085040F18ADE77A7AF1A7F3DE06ABAFEAF6705A58ACD11374951B17C6D7116AD8094426FCA482C517CDCB7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77633BACAB33B9508C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6759CC434672EE6371C2A783ECEC0211ADC4224003CC836476D5A39DEEDB180909611E41BBFE2FEB2B8DB3B6D2B9771BC5BB170801E64165D414CD0B013C13BD597178B8319EB1076D9FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B2EE5AD8F952D28FBA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC607BC8948D1633203AA81AA40904B5D9CF19DD082D7633A0C84D3B47A649675F3AA81AA40904B5D98AA50765F7900637F9CAB0A5B52385A6D81D268191BDAD3D3666184CF4C3C14F3FC91FA280E0CE3D1A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E62526D8C47C27EEC5E9FB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5848277BD6BB09A355002B1117B3ED69692B9692DDA224D86D57BAD45EC4C5DE1823CB91A9FED034534781492E4B8EEADAE4FDBF11360AC9BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6598627827C49ECAA0354C88B8DF3ABF1D51E345E41326EC72E4FDE160FC62C5D6C37EC6D4C0A881FDCB8341EE9D5BE9A0A5FC5BB42ED6C13156B9FB07D8EBB2D55C4CF2E444C9953C78CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVTZJppT4ZVHRJQzuoggV1Ac= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458D113154CAB275AB6ED188C5D0CCD93D46857CA6BE96CDD84B83042B04BEE9B53645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 15/41] perf: adjust md5 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. --------------nsCOiazv5JU5Q0Urpcqjf4t0 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/md5.lua | 30 ++++++++++++++++++++++++------ > 1 file changed, 24 insertions(+), 6 deletions(-) > > diff --git a/perf/LuaJIT-benches/md5.lua b/perf/LuaJIT-benches/md5.lua > index fdf6b4a7..556a0cd5 100644 > --- a/perf/LuaJIT-benches/md5.lua > +++ b/perf/LuaJIT-benches/md5.lua > @@ -1,5 +1,11 @@ > +-- Benchmark to check the performance of the bit operations. > +-- Calculates the MD5 hash sum from the fixed string. > +-- For more details about the MD5 algorithm see: > +--https://en.wikipedia.org/wiki/MD5 > > 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 +153,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 > > -- Credits: William Shakespeare, Romeo and Juliet > local txt = [[Rebellious subjects, enemies to peace, > @@ -176,8 +182,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 _ = 1, N do > + res = md5(txt) > + end > + return res > + end, > + checker = function(res) > + assert(res == 'a831e91e0f70eddcb70dc61c6f82f6cd') > + return true > + end, > + items = N, > +}) > + > +bench:run_and_report() --------------nsCOiazv5JU5Q0Urpcqjf4t0 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/md5.lua | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/perf/LuaJIT-benches/md5.lua b/perf/LuaJIT-benches/md5.lua
index fdf6b4a7..556a0cd5 100644
--- a/perf/LuaJIT-benches/md5.lua
+++ b/perf/LuaJIT-benches/md5.lua
@@ -1,5 +1,11 @@
+-- Benchmark to check the performance of the bit operations.
+-- Calculates the MD5 hash sum from the fixed string.
+-- For more details about the MD5 algorithm see:
+-- https://en.wikipedia.org/wiki/MD5
 
 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 +153,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
 
   -- Credits: William Shakespeare, Romeo and Juliet
 local txt = [[Rebellious subjects, enemies to peace,
@@ -176,8 +182,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 _ = 1, N do
+      res = md5(txt)
+    end
+    return res
+  end,
+  checker = function(res)
+    assert(res == 'a831e91e0f70eddcb70dc61c6f82f6cd')
+    return true
+  end,
+  items = N,
+})
+
+bench:run_and_report()
--------------nsCOiazv5JU5Q0Urpcqjf4t0--