Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Rust is now faster than C

Name: Anonymous 2017-02-21 18:14

http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=knucleotide

How can this be? Since C is as fast as assembly, does this mean Rust does some microcode optimilzation under the hood?

Name: Anonymous 2017-02-21 23:39

C is one of the worst languages to optimize, even with all that fake bullshit that ``modern'' mainstream C compilers do.

All of that pointer junk that helped make things faster on a PDP-11 slows down modern CPUs and confuses modern compilers.

C compilers remove your bounds checks and null checks that you, the programmer, explicitly wrote in the program, even if they are known to fail, and then crash on input that your checks would have prevented. The real scary thing is that people had to write code to determine that you're checking array bounds and more code to remove the check.

Any other language compiler would insert checks if you don't write them, unless it's 100% proven that they won't fail (i.e. compile-time constants). C compilers do the total opposite.

C has no portable way to check for overflow. Overflow is almost always a bug.

And C programs still end up slower than languages that do all of these checks despite C compilers removing code you wrote. This is because higher-level languages can be optimized much better than C and its fictional pseudo-Brainfuck memory model can.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List