From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 88928469710 for ; Tue, 19 May 2020 11:34:26 +0300 (MSK) From: "Timur Safin" References: <172feb69ec2caea2aa63a24de8b76a4dba13bebb.1589583614.git.v.shpilevoy@tarantool.org> <52af1bb7-b125-7490-3882-ce74698789d2@tarantool.org> In-Reply-To: Date: Tue, 19 May 2020 11:34:24 +0300 Message-ID: <353d01d62db8$4dc09f30$e941dd90$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH 2/2] uuid: fix unaligned memory access List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Aleksandr Lyapunov' , 'Vladislav Shpilevoy' , tarantool-patches@dev.tarantool.org, gorcunov@gmail.com : From: Aleksandr Lyapunov :=20 :=20 : > Could you please show the benchmark? I did my own, and I can't see = any : > significant difference. The present difference is so small, that it : > looks like jitter. Both in is_nil and is_eq. : > : > I did a very simple bench in Lua, without any GCed objects. : : I fear that Lua is not suitable for performance tests. : Here you are: https://pastebin.com/VXkS1v6M : Also please take a look at disasm: https://godbolt.org/z/s6Cti4 Haha, good example - love it! One may assume that this is awkward C++ = aliasing rules (where only std::byte_t, char, and unsigned char are = aliasing) and=20 should look differently in C mode, but no - it's the same for C enforced https://godbolt.org/z/fdbBLf So I'd agree - memcmp is the simplest way to do the fastest comparison = while=20 Keeping that picky aliasing analysis in compiler happy.=20 Regards, Timur