From: "Timur Safin" <tsafin@tarantool.org> To: 'Aleksandr Lyapunov' <alyapunov@tarantool.org>, 'Vladislav Shpilevoy' <v.shpilevoy@tarantool.org>, tarantool-patches@dev.tarantool.org, gorcunov@gmail.com Subject: Re: [Tarantool-patches] [PATCH 2/2] uuid: fix unaligned memory access Date: Tue, 19 May 2020 11:34:24 +0300 [thread overview] Message-ID: <353d01d62db8$4dc09f30$e941dd90$@tarantool.org> (raw) In-Reply-To: <f0774d12-0fdd-c922-05e3-e299640d6187@tarantool.org> : From: Aleksandr Lyapunov <alyapunov@tarantool.org> : : : > 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 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 Keeping that picky aliasing analysis in compiler happy. Regards, Timur
next prev parent reply other threads:[~2020-05-19 8:34 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-15 23:03 [Tarantool-patches] [PATCH 0/2] Sanitize uuid and bit alignment Vladislav Shpilevoy 2020-05-15 23:03 ` [Tarantool-patches] [PATCH 1/2] bit: fix unaligned memory access and UB bit shift Vladislav Shpilevoy 2020-05-21 14:37 ` Timur Safin 2020-05-15 23:03 ` [Tarantool-patches] [PATCH 2/2] uuid: fix unaligned memory access Vladislav Shpilevoy 2020-05-18 12:55 ` Aleksandr Lyapunov 2020-05-18 21:17 ` Vladislav Shpilevoy 2020-05-19 7:28 ` Aleksandr Lyapunov 2020-05-19 8:34 ` Timur Safin [this message] 2020-05-19 21:24 ` Vladislav Shpilevoy 2020-05-20 8:18 ` Aleksandr Lyapunov 2020-05-20 21:38 ` Vladislav Shpilevoy 2020-05-21 8:28 ` Aleksandr Lyapunov 2020-05-21 14:37 ` Timur Safin 2020-05-21 19:33 ` [Tarantool-patches] [PATCH 0/2] Sanitize uuid and bit alignment Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='353d01d62db8$4dc09f30$e941dd90$@tarantool.org' \ --to=tsafin@tarantool.org \ --cc=alyapunov@tarantool.org \ --cc=gorcunov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 2/2] uuid: fix unaligned memory access' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox