NibblePoker's Clang Goodies 1.0.0
Small collection of utilities and libraries for C in order to simplify some development tasks.
|
These benchmarks serve as justifications for some of my choices in some small pieces of code throughout my library.
Unless someone can find more efficient ways to perform these actions, I will not accept modifications to these bits of code.
And especially not if "mUh CleAN coDe IS BeTTer" is waived around.
Test Machine:
More test machines will be added once the hashmaps are done.
There should be Win32 and Linux x64, and ARM64 Linux.
Test Conditions:
RELEASE
target.Programming Conventions:
Compares the performances of multiple CRC32B variants on a 512 MiB block of random data.
Variant | Time (s) | Hash rate (MiB/s) | Hash rate (Mib/s) |
---|---|---|---|
Original - Branchless | 5.84 | 87.701268 | 701.610140 |
Original - Condition | 3.43 | 149.358226 | 1194.865811 |
Reduced - Branchless | 5.90 | 86.750254 | 694.002033 |
Reduced - Look-up | 1.08 | 474.513438 | 3796.107507 |
Source Code (bm_crc32_implementations.c)
Compares the performances between the 2 following pieces of code:
pow(2, exponent)
2 << (exponent - 1)
Results:
Remarks:
Limitations:
exponent == n
if n
is our integer bit size/width.