Public
Authored by Ondřej Surý

hash.c

Compile with:

export CC=<gcc|clang>
$CC -std=gnu11 -O3 -funroll-loops hash.c -o hash-O3-unroll-loops && $CC -std=gnu11 -O3 -fno-unroll-loops hash.c -o hash-O3-no-unroll-loops && $CC -std=gnu11 -O2 -funroll-loops hash.c -o hash-O2-unroll-loops && $CC -std=gnu11 -O2 -fno-unroll-loops hash.c -o hash-O2-no-unroll-loops && $CC -std=gnu11 -O3 hash.c -o hash-O3 && $CC -std=gnu11 -O2 hash.c -o hash-O2 && $CC -std=gnu11 -Ofast -funroll-loops hash.c -o hash-Ofast-unroll-loops && $CC -std=gnu11 -Ofast -fno-unroll-loops hash.c -o hash-Ofast-no-unroll-loops && $CC -std=gnu11 -Ofast hash.c -o hash-Ofast

Test with:

for TEST in $(ls -1 hash-* | sort); do echo -n "$TEST "; ./$TEST 1000000000000000000 "The quick brown fox jumps over the lazy dog."; done
Edited
3.91 KB
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment