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 D2AF6167920D; Fri, 26 Dec 2025 11:22:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D2AF6167920D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1766737333; bh=Qfw2t4+YKW8ru/YP+tOr03Jdh6Ax/udBKhtJyhED9Ys=; 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=g/Mr67uFSskquMdtZzUp3AXsrExwsQ2FBhgqcGV2zrJ/RuNrfT/JEhivojPNlvVJY Wy1Hx503QMJpepy98AG61WULGH676MNHDhmrL+AZVhD5PmR+NeQH8IdhZXxTME5MRx SOw/An4HXokEwL9yvamwI4UawnbspdAr2n2J8elk= Received: from send218.i.mail.ru (send218.i.mail.ru [95.163.59.57]) (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 A51B01679216 for ; Fri, 26 Dec 2025 11:22:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A51B01679216 Received: by exim-smtp-7b4fb89df9-pbtpt with esmtpa (envelope-from ) id 1vZ35O-00000000OMr-2y3K; Fri, 26 Dec 2025 11:22:11 +0300 Date: Fri, 26 Dec 2025 11:22:08 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <124c286f2d9d6d9b9ce227e6f2b8f25258208987.1761301736.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD979975AF0D777FEBDBD402C266276CBAD49C55E60069EDAD4182A05F53808504091C0D23860E9505D3DE06ABAFEAF6705D0C3718DC4231442C3CE4153D521EAFE14E64ECD1FAFC5AC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71EAE3A63419E5AEDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566657B88B02DF8C86981A18C6098BB47CE3CB3D4B07E39034534B2B9E56537041E389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3BE90F13D913F449135872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A57136848B2364DD855002B1117B3ED696A423AEEBC1153DDBAD0703CEB2EF9A27823CB91A9FED034534781492E4B8EEAD4ECBDE8281F904F9BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659582F5C6291A5A4C5C6E23370001B6762DAC0E486EEE9BD844DAD6776CB95502E07B24A1C3E11BD33B8341EE9D5BE9A0A49EAEA06DF5C5A19569973BC3682B4BA741825EC8DAC27CD8CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdtTL5f5BIXbuHnkcwzYOiE= X-DA7885C5: FF7ED0DABC45EFB3F255D290C0D534F976CB9BF3D8F9897618C71AA85941BFA00B3BEBCBA20BACDE5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393DDD5FD59B456EAD24633F4B12B69642B833A039D9461C1735EE51A9261B7797EE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! Please consider my comments below. On 17.11.25, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for the patch! See  my comments. > > Sergey > > On 10/24/25 13:50, 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 | 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 Added the comment with the short benchmark description, as we discussed offline: =================================================================== diff --git a/perf/LuaJIT-benches/md5.lua b/perf/LuaJIT-benches/md5.lua index 2a96de95..556a0cd5 100644 --- a/perf/LuaJIT-benches/md5.lua +++ b/perf/LuaJIT-benches/md5.lua @@ -1,3 +1,8 @@ +-- 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) =================================================================== > > @@ -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 > this deserves a comment, why 20000 instead 10000? It is the default for x86 arch. I've taken the values from PARAMS_x86, since this is the most important architecture for the Tarantool, see the commit message. > > > > -- 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 > s/1,/1, / Fixed: =================================================================== diff --git a/perf/LuaJIT-benches/md5.lua b/perf/LuaJIT-benches/md5.lua index 5ec67527..2a96de95 100644 --- a/perf/LuaJIT-benches/md5.lua +++ b/perf/LuaJIT-benches/md5.lua @@ -181,7 +181,7 @@ bench:add({ name = 'md5', payload = function() local res - for i=1,N do + for _ = 1, N do res = md5(txt) end return res =================================================================== > > + res = md5(txt) > > + end > > + return res > > + end, > > + checker = function(res) > > + assert(res == 'a831e91e0f70eddcb70dc61c6f82f6cd') > > + return true > > + end, > > + items = N, > > +}) > > + > > +bench:run_and_report() -- Best regards, Sergey Kaplun