Skip to content

Performance issues #4703

Answered by Darksonn
tingfeng-key asked this question in Q&A
May 19, 2022 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Looking over the code, the following thoughts come to mind:

  1. The version of the code available when the article was posted ran all of their code inside block_on rather than inside spawned task. It's known that this hurts performance of IO in Tokio. The ping tests appear to have fixed this since the article was posted, but it's still the case in the pong tests, and the article hasn't been updated since the ping tests were fixed.
  2. The tests appear to make significant use of sleeping to time the messages. However, Tokio's timer only has a resolution of one millisecond. This can cause the Tokio tests to spend a lot longer sleeping than the other tests. For example, the benchmarks uses sleeps a…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by tingfeng-key
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Darksonn
Comment options

@Mallets
Comment options

@carllerche
Comment options

@carllerche
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants