3 ms·
We've implemented network drivers in C and Rust and did a performance comparison. Interestingly, the C-to-Rust-transpiled code ended up being faster than the or
by ackxolotl 6y ago
We've implemented network drivers in C and Rust and did a performance comparison. Interestingly, the C-to-Rust-transpiled code ended up being faster than the original C implementation: https://github.com/ixy-languages/ixy-languages/blob/master/Rust-vs-C-performance.md https://github.com/ixy-languages/ixy-languages/blob/master/R...
- jmacjmac 6y agohttps://github.com/emmericp/ixy/blob/0e00605be4153b06df06184b5dc0401113c2c7fb/CMakeLists.txt#L6 https://github.com/emmericp/ixy/blob/0e00605be4153b06df06184... Looks like you're compiling C code with -O2. Does Rust build set -O3 on clang? Did you try -O3 with C? I know it's not guaranteed to be faster, just curious.
- Shadonototro 6y agoGood catch
- dralley 6y agoIt looks like the answer is "yes" https://doc.rust-lang.org/cargo/reference/profiles.html#release https://doc.rust-lang.org/cargo/reference/profiles.html#rele...
- jmacjmac 6y agoThen a fair benchmark would be compiling C code with clang -O3 :)