4 ms·
C has 1.64, even better, I’ve intentionally omitted that, but that is the reference for cases “it doesn’t have to be new fashion but has to be fast.”
by acqq 7y ago
C has 1.64, even better, I’ve intentionally omitted that, but that is the reference for cases “it doesn’t have to be new fashion but has to be fast.”
- nicoburns 7y agoYes, but writing C is a completely different, and much more onerous experience. You have no sensible strings or hashmaps in the standard library, and using external libraries is a massive pain. That's not even to mention Undefined Behaviour and memory safety issues. For most data-munging programs, python, node, java, and rust code will be roughly similar (Java and Rust will make you annotate types). I've been amazed at the performance you can get from Rust code that looks practically identical to the equivalent JavaScript.
- acqq 7y agoSee the C source I don’t find it less readable than Rust version. https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/mandelbrot-gcc-6.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- nicoburns 7y agoTo be honest I find both the fastest C and Rust answers ("C gcc #6" @ 1.64s and "Rust #6" @ 1.70s) highly unreadable. For me, "Rust #5" @ 1.98s is the first readable solution in the list, and seems comparable (code wise) with the Java, Python, etc implementations. ("C++ g++ #6" is also quite reasonable, but that's C++, not C).
- igouy 7y agoHow does "unreadable" relate to source code size for you? https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/mandelbrot-gz.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...