TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Async Rust in Practice: Performance, Pitfalls, Profiling

248 pointsby uberdruover 3 years ago

7 comments

carllercheover 3 years ago
Tokio author here. Generally speaking, I recommend strongly against using FuturesUnordered unless you know all the pitfalls. We are working on an alternative utility that should hopefully avoid the issues described here and others: <a href="https:&#x2F;&#x2F;github.com&#x2F;tokio-rs&#x2F;tokio&#x2F;pull&#x2F;4335" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tokio-rs&#x2F;tokio&#x2F;pull&#x2F;4335</a>
评论 #29912539 未加载
psarnaover 3 years ago
Hi, author of the post here. I&#x27;ll also be talking about this issue in a little more detail at an online Rust Warsaw meetup tomorrow, feel free to join, especially if you&#x27;re up for a live discussion later: <a href="https:&#x2F;&#x2F;www.meetup.com&#x2F;Rust-Warsaw&#x2F;events&#x2F;282879405&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.meetup.com&#x2F;Rust-Warsaw&#x2F;events&#x2F;282879405&#x2F;</a>
评论 #29914655 未加载
评论 #30003882 未加载
eminence32over 3 years ago
Nice article, and nice analysis of the problem.<p>I have a personal theory that once a codebase gets complicated enough (no matter the language, no matter sync or async), you&#x27;ll run into subtle bugs or performance problems that require a very deep understanding of all the relevant libraries in order to resolve the problem. One worry that I have with async rust is that the executors are so complex that the &quot;baseline complexity&quot; starts rather high.<p>If this theory is true, then one might expect async rust to run into such problems more often than comparable non-async code. I haven&#x27;t personally written enough async code to have any data either way, except for a few unpleasant experiences while making errors when writing async code.<p>To the extent that this theory is a problem that needs solving, I don&#x27;t think there is a solution. But I do think that, over time, weird async footguns will become less and less frequent as projects like tokio continue their excellent engineering efforts to plug up any weak spots and make things more robust in general.
评论 #29913199 未加载
评论 #29917725 未加载
评论 #29917027 未加载
gxtover 3 years ago
It&#x27;s a great story and it&#x27;s pleasant to see end-devs investigations contribute to the overall performance of the ecosystem since Tokio is so widely used. Cheers
scottlambover 3 years ago
Nice article. I&#x27;m in the process of absorbing it. Question:<p>&gt; scylla-rust-driver issued at least 1 syscall per query, which might be the source of elevated latency – and with a super-fast network (of which loopback is a prime example) it also means that throughput suffers – a latency of 1ms means that we won’t be able to send more than 1000 requests per second.<p>Is 1 ms measured? Buffering and reducing syscalls is good, but still: that seems horribly slow for a small or EWOULDBLOCK-returning read&#x2F;write. Why would it be that bad?
评论 #29914874 未加载
dagmxover 3 years ago
I&#x27;d love to read this article but man this site is painful on mobile. Multiple popups from the top, header that overlays the text, the chat bubble at the bottom.<p>It really reduces the amount of space for the actual content<p>When comparing to Reader View in Safari, the native site has at least 40% less viewing area
评论 #29912426 未加载
评论 #29912292 未加载
评论 #29914098 未加载
评论 #29912322 未加载
throwaway81523over 3 years ago
I haven&#x27;t even clicked the link yet, but that the Scylla devs are doing something with Rust already is interesting. Seastar is very cool though constrained by the limitations of C++. It will be great to find out what effect Rust has.
评论 #29916408 未加载