5 ms·
The performance hit you take for doing dynamic dispatch is real and measurable. It's a no-go if you're in a performance sensitive part of your app.
by ccleve 1y ago
The performance hit you take for doing dynamic dispatch is real and measurable. It's a no-go if you're in a performance sensitive part of your app.
- selfmodruntime 1y agoI write rust for no_std embedded devices and I just use stack_dst for this :) Of course you‘re right if you can‘t alloc, you can‘t use Box or similar stuff. Also you can avoid a lot of performance hits if you just implement most stuff on the dyn Trait directly!
- surajrmal 1y agoSure but most code paths are not hot. This is definitely premature optimization at the expense of everything else.