Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Arecv much slower than sync recv #124

Open
pumpthis opened this issue Jan 20, 2024 · 3 comments
Open

Question: Arecv much slower than sync recv #124

pumpthis opened this issue Jan 20, 2024 · 3 comments

Comments

@pumpthis
Copy link

pumpthis commented Jan 20, 2024

Testing on my server shows that comparing sync recv with async arecv, performance is very different.

msg = sub0.recv()
The minimum time gap between two messages is 2us

when I change the code to
msg = await sub0.arecv()
The minimum time gap between two messages is 35us

I've tried both asyncio and trio. Is there any way to improve the async client performance?
Too many sync clients cause significant context switches, but the message speed in async client seems slow.

@carlodri
Copy link

Shouldn't you be saying msg = await sub0.arecv()?

@pumpthis
Copy link
Author

Shouldn't you be saying msg = await sub0.arecv()?

sorry it's a typo.

@codypiersall
Copy link
Owner

If you have a few test scripts I would be interested in trying them out.

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

No branches or pull requests

3 participants