3 ms·
Right, but it depends on how the code is written, right? If you use mostly free functions things will shake out naturally, if you use lots of dynamic dispatch
by iainmerrick 1y ago
Right, but it depends on how the code is written, right?
If you use mostly free functions things will shake out naturally, if you use lots of dynamic dispatch you'll pull in stuff that doesn't get called.
- steveklabnik 1y agoRust does static dispatch even for non-free functions. Only trait objects are dynamically dispatched, and most people argue they’re under-used in Rust, not overused. If that does become a problem, there are also techniques like https://github.com/rust-lang/rust/issues/68262 https://github.com/rust-lang/rust/issues/68262 too.