3 ms·
nice! been waiting on this one for ages. Any idea if removing the implicit box-ing that async_trait uses has a measurable impact on performance? Are there some
by leshow 3y ago
nice! been waiting on this one for ages. Any idea if removing the implicit box-ing that async_trait uses has a measurable impact on performance?
Are there some cases, say with really big futures, where removing the boxing actually hurts performance?
- tmandry 3y agoI don't have numbers handy, but I can say with confidence that the answer to both questions is "yes". It depends on the use case. Boxing is a useful tool and in many cases the overhead is minimal, but you don't want to use it all the time. Likewise, static inlining can bite you in deeply nested cases and I've heard of this happening too. The future we're working toward is for this to be a decision you can make locally without introducing compatibility hazards or having to change a bunch of code. Ideally, one day you can even ask the compiler to alert you to potential performance hazards or make reasonable default choices for you...