▲ | pclmulqdq 3 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Idiomatic "low level" rust clocks in at about 10-50% slower than hand-coded C every time I try it. It is also about 10x easier to write the Rust code. Unsafe is just required a lot of the time. Sometimes it's code size or struct size just being larger to express a similar concept. To get back your performance you have to do things that are un-idiomatic (but you have to do in C anyway). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | simonask 3 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
That is an unbelievable claim. 1. Rust structs are generally smaller due to layout optimization. 2. A 10-50% difference is well within the “are you measuring debug builds?” territory. I’m curious what code you are writing that requires unsafe all the time? I do a lot of low-level optimization, and unsafe is barely ever actually needed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | Arch-TK 3 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Show examples please. |