3 ms·
So you think that it's expected that C is 10 times faster than Rust?
by lawn 5y ago
So you think that it's expected that C is 10 times faster than Rust?
- sillysaurusx 5y agoWow. Perhaps I should be embarrassed, but I mentally filled in "30 GB/s" instead of 3 GB/s. I thought Rust was mostly neck and neck with C. I see now why a lot of fellows responded in a defensive way. What's it doing to be so much slower? That's shocking. I may not enjoy Rust, but I do respect its ability to approach C++ performance.
- Arnavion 5y agoAt the very least, the itoap crate being used there does divisions by and comparisons to powers of 10 as part of stringifying integers, which the C and ASM versions don't seem to be doing. A crate with a function for stringifying arbitrary integers cannot take advantage of the fact that it's going to be used for stringifying consecutive integers, as an inlined solution can.
- deleted 5y ago[deleted]
- IshKebab 5y ago> That's shocking. Not really. This is a hyper optimised microbenchmark. The actual work being done is so trivial that any "overhead" is really significant and you can get order of magnitude speedups by doing arcane things with caches, eliminating tiny inefficiencies and so on.
- xxpor 5y agoComplete speculation, but I think you'd find that's true for most problems. Very little CPU time is spent on the business logic, and the rest is overhead.
- misja111 5y agoAs far as I understand, that #2 C program contains hardly any C code but mostly inlined assembly.
- bonzini 5y agoThe program itself is 100% C, but it spends 99.9999% of the time in assembly code that is generated at runtime.
- friedman23 5y agoI'm curious, how did rust affect you so badly that you hate it so much? If it's just silly people suggesting it everywhere I think you have some personal issues you need to resolve, language choice isn't something to get emotional about.
- deleted 5y ago[deleted]
- ask_b123 5y agoI've not seen any indication that sillysaurusx hates Rust.