[Tarantool-patches] [PATCH 2/2] uuid: fix unaligned memory access

Timur Safin tsafin at tarantool.org
Tue May 19 11:34:24 MSK 2020


: From: Aleksandr Lyapunov <alyapunov at 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



More information about the Tarantool-patches mailing list