|
|
|
|
|
by tialaramex
473 days ago
|
|
> But then again Rust devs are more likely to use static dispatch via generics if performance is critical. Put another way, in C++ the dynamic dispatch is implicit, so you might write code which (read literally) has dynamic dispatch but the optimizer will devirtualize it. However in Rust dynamic dispatch is explicit, so, you just would not write the dynamic dispatch - it's not really relevant whether an optimizer would "fix" that if you went out of your way to get it wrong. It's an idiomatic difference I'd say. |
|