Posted by carllerche 3 hours ago
You should, of course, upper bound this overhead by switching to a full time travel debugging solution, thus tracing everything, when you get to the 10-30% range.
The only way you get to “majority” is if your trace implementation is slower than time travel debugging and provides less information, but then why choose something worse in every dimension.
1: https://llvm.org/docs/XRay.html ... is there even a Rust analog to this?
It's worth pointing out though that just tracing function calls isn't good enough for the kinds of stackless coroutines that run in async Rust tasks. You need a way of mapping between the async tasks and the compiler emitted traces.
afaik, C/C++ have the same problem.
Before you say Axum is "holding it wrong" the project lives under the tokio-rs GitHub org.