We do not claim that Rust is so much performant than C, we just showed that Rust can be as fast as Fortran or C. And indeed, there must be something wrong with the C implementation. Pull requests with improvements are welcome:
Also the output is [[NaN, NaN, NaN], [NaN, NaN, NaN]], which is a bit worrying...
Not sure how much this affects the benchmark, but it'd probably be smart to randomise the starting positions.
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.