top | item 44625071 (no title) ccleve | 7 months 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. discuss order hn newest j-krieger|7 months ago I 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|7 months ago Sure but most code paths are not hot. This is definitely premature optimization at the expense of everything else.
j-krieger|7 months ago I 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|7 months ago Sure but most code paths are not hot. This is definitely premature optimization at the expense of everything else.
j-krieger|7 months ago
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|7 months ago