Topic: UUID and perf
Hi,
from a discussion about UUID perf here:
https://dev.to/fredbouchery/performance-des-uuids-29dj
sorry in french
I have rewritten `uuid_parse` and uuid_unparse
This brings a better performance, mainly for uuid_unparse.
May I propose the change although it will not use uuid parse and unparse implementation from the distribution ?
For example unparse will use something like
char const __str_digits_lower[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
static void __uuid_fmt(char buf[UUID_STRING_LEN + 1], const uuid_t uuid)
{
char *p = buf;
for (int i = 0; i < 16; i++) {
if (i == 4 || i == 6 || i == 8 || i == 10) {
*p++ = '-';
}
*p++ = __str_digits_lower[uuid[i] >> 4];
*p++ = __str_digits_lower[uuid[i] & 15];
}
*p = '\0';
}