GCC produces almost 30% more instructions for the C version at -O3 level as opposed to -O2.
Clang produces practically the same between the two levels.
On OS X, so can't test if this actually makes a performance difference.
Clang produces practically the same between the two levels.
On OS X, so can't test if this actually makes a performance difference.
GCC 6.3, -Ofast: 5.93s
GCC 6.3, -O3: 93.06s
GCC 6.3, -O2: 134.43s
Clang 3.9, -O3: 346.92s
Clang 3.9, -Ofast: 5.87s
Intel 15.0, -O3: 110.84s
Intel 15.0, -Ofast: 106.88s
The Intel compiler is relatively old, but mostly it seems to be a case of IEEE 754 conformance -- if enabled, things take longer, if disabled, they’re (probably) as fast in C as in Rust.The `time` command is part of base OS X.