This is a benchmark comparing different methods of bits reverse in byte in C.
There are several implemented methods to reverse bits:
- simple loop over all bits
- bitfields and union
- swapping
- small (reduced) lookup table
- big (full) lookup table
- magic with constants
- clang's builtin method
Benchmark measures run times of implementations built by GCC and Clang for every optimization level (Os, O0-O3).
To run:
- install GCC, Clang, Make
- run
run.sh
script