Oneshot perfromance #3410
Unanswered
tkaitchuck
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Did you try out other channel implementations? Some options are:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a rather large and somewhat complex application that is getting completely bottlenecked on the performance of
oneshot
s.High level overview of what's happening:
The caller calls the function to create the oneshot and then awaits it and then awaits the oneshot over and over in a loop.
Flame graph is attached. (unfortunately git doesn't allow svgs so it's just a PNG zoomed in)
What's odd about that is that the same code path actually uses two
mpsc
s and those barely register on the flamegraph at all. I tried just replacing the oneshots with mpscs but actually was slower.Is there some way to speed up this sort of "creating, using, and dropping" oneshots in a loop? Maybe a way to avoid the
wake_by_ref
call which for whatever reason don't seem to be happening withmpsc
s when they are used for many messages?Beta Was this translation helpful? Give feedback.
All reactions