2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00
Andrey Semashev ba77fe2781 Added SSE2 and SSSE3 SIMD implementations of from_chars.
This adds SSE2 and SSSE3 code paths to from_chars_x86.hpp. The performance
effect on Intel Golden Cove (Core i7-12700K), gcc 13.3, in millions of
successful from_chars() calls per second:

Char     | Generic | SSE2            | SSSE3           | SSE4.1          | AVX2            | AVX512v1
=========+=========+=================+=================+=================+=================+================
char     |  40.475 | 327.791 (8.10x) | 465.857 (11.5x) | 555.346 (13.7x) | 504.648 (12.5x) | 539.700 (13.3x)
char16_t |  38.757 | 292.048 (7.54x) | 401.117 (10.3x) | 478.574 (12.3x) | 426.188 (11.0x) | 416.205 (10.7x)
char32_t |  50.200 | 150.900 (3.01x) | 204.588 (4.08x) | 389.882 (7.77x) | 359.591 (7.16x) | 349.663 (6.97x)

In addition, the workarounds to avoid (v)pblendvb instructions have been
extended to Intel Haswell and Broadwell, as these microarchitectures have
poor performance with these instructions (including the SSE4.1 pblendvb).

Two new experimental control macros added: BOOST_UUID_FROM_CHARS_X86_SLOW_PBLENDVB
and BOOST_UUID_FROM_CHARS_X86_USE_PBLENDVB. The former indicates that
(v)pblendvb instructions are slow and should be avoided on the target
microarchitectures. The latter indicates that (v)pblendvb should be used
by the implementation. The latter macro is derived from the former and
takes precedence. As before, these macros can be used for experimenting
and fine tuning performance for specific target CPUs. By default,
BOOST_UUID_FROM_CHARS_X86_SLOW_PBLENDVB is defined for Haswell/Broadwell
or if AVX is detected.

Lastly, made selection between blend-based and shuffle-based character
code conversion in various places unified, controlled by a single
internal macro BOOST_UUID_DETAIL_FROM_CHARS_X86_USE_BLENDS.
2026-01-10 12:15:59 +03:00
2024-04-25 22:50:04 +03:00
2026-01-10 02:41:29 +02:00
2024-04-20 23:08:51 +03:00
2024-08-23 19:43:03 +03:00
2024-04-24 20:29:41 +03:00
2018-04-29 09:57:56 -04:00

Boost.Uuid

Boost.Uuid, part of Boost C++ Libraries, provides a C++ implementation of Universally Unique Identifiers (UUID) as described in RFC 4122 and RFC 9562.

See the documentation for more information.

License

Distributed under the Boost Software License, Version 1.0.

Properties

  • C++11 (since Boost 1.86.0)
  • Header-only

Current Status

Branch Github Actions Appveyor Dependencies Documentation Test Matrix
master Build Status Build status Deps Documentation Enter the Matrix
develop Build Status Build status Deps Documentation Enter the Matrix

More Information

  • Ask questions
  • Report bugs: Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
  • Submit your patches as pull requests against the develop branch. Note that by submitting patches you agree to license your modifications under the Boost Software License, Version 1.0.
  • Discussions about the library are held on the Boost developers mailing list. Be sure to read the discussion policy before posting and add the [uuid] tag at the beginning of the subject line.

Code Example - UUID Generation

//  mkuuid.cpp example

#include <boost/uuid.hpp>
#include <iostream>

int main()
{
    boost::uuids::random_generator gen;
    std::cout << gen() << std::endl;
}
$ clang++ -Wall -Wextra -std=c++11 -O2 mkuuid.cpp -o mkuuid
$ ./mkuuid
2c186eb0-89cf-4a3c-9b97-86db1670d5f4
$ ./mkuuid
a9d3fbb9-0383-4389-a8a8-61f6629f90b6
Description
Mirrored via gitea-mirror
Readme BSL-1.0 1.4 MiB
Languages
C++ 98.3%
CMake 1.1%
Shell 0.3%
Batchfile 0.2%