]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libuuid: improve uuid_unparse() performance
authorAurelien LAJOIE <orel@melix.net>
Thu, 26 Mar 2020 14:38:27 +0000 (15:38 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Mar 2020 13:29:39 +0000 (15:29 +0200)
commit2f81213e269655728bc7971cbc09d5db20e2b855
treed02c630331c2f11ab0d125a48e71ef50a3dc055d
parentbe0044b812849ad8624c494f18f14f1e851f8942
libuuid: improve uuid_unparse() performance

There is 2 improvements:

 * remove useless uuid_unpack,
 * directly print the hexa format from memory without using printf
   we can do this as the bytes order is the network byte order
   https://tools.ietf.org/html/rfc4122#section-4.1.2
   even the spatially unique node identifier(the last 6 bytes)

The improvement is important, some results for 1000000 uuid_unparse calls:

Little Endian Ubuntu:
before took 382623 us
after  took  36740 us

Big Endian OpenBSD:
before took 3138172 us
after  took  180116 us

Signed-off-by: Aurelien LAJOIE <orel@melix.net>
libuuid/src/unparse.c