Skip to content

Conversation

HyeonuPark
Copy link

This is a post to share experiment, not actual pull request. But its result is too impressive I couldn't resist sharing them. On my not-so-strict linux env, it shows clear ~40% perf improvement.

pdf

I don't have proper benchmark env setup ATM, but you can test it on your own env too.

But there's few subtle issues to note before shipping this idea:

  1. It uses waker_getter nightly feature. This feature seems pretty trivial and I expect it to be stable soon-ish, but even if it happens it will take a quite while for this feature to follow up the MSRV policy.
  2. It wraps/replaces the waker passed. A different waker is passed to downstack, deactivates Waker::will_wake() based optimizations.
  3. Again this change replaces the waker, other libs that detects its own vtable like embassy would be affected as it's not their own vtable anymore. To workaround this issue the stream! / try_stream! macros can unpack the inner waker before polling its inner async block. But this implementation would not be trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant