Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align boost::uuid to 16 bytes on 64-bit targets, to 4 on 32-bit.
On 64-bit targets, this improves performance of operations on UUIDs as the UUID object now does not cross page boundary. It may also improve code generation by compilers, which can now assume that loads and stores of UUIDs are not as expensive and therefore it may be more preferable to use vector instructions for that. On 32-bit targets, we cannot guarantee that boost::uuid is always aligned to 16 bytes because stack and dynamic memory allocations typically have lower default alignment (typically 4 or 8). For this reason, we only require alignment of 4, and also do not change SIMD intrinsics used in boost::uuid operations to their aligned equivalents. Using unaligned load/store instructions on actually aligned memory location on modern CPUs has the same performance as using aligned instructions, so the performance benefit is still there on 64-bit targets. Closes #139.
- Loading branch information