2,033 karma · joined February 20, 2010
Should anyone have thoughts on potential guests or know someone who would be an incredible guest, I'd love to hear about it.
"Doing the right thing" can vary based on the context. For instance, in embedded systems where threads aren't available, requiring futures to be Send is unnecessary. Thankfully, the standard library does not enforce this and neither does Tokio with spawn_local, but embassy exists because there's a genuine need for async frameworks tailored to the unique constraints and requirements of embedded systems.
Rust, on the other hand, took a different route. Green threads don't integrate smoothly with code interfacing through FFI. Moreover, Rust's async model doesn't require a garbage collector.
LocalSet + spawn_local are great, and I wish more developers would know about them, but the Tokio tutorial [1] doesn't mention that and focuses on the multi-threaded runtime instead. AFAIK LocalSet is only mentioned in the docs [2]
[1]: https://tokio.rs/tokio/tutorial [2]: https://docs.rs/tokio/latest/tokio/task/struct.LocalSet.html
Interestingly, when working with a limited number of threads, the thread approach is actually faster in that benchmark. So in practical applications, the differences are marginal and likely lean towards threads.
But even if this weren't the case, context matters. A 10ms discrepancy in a web request might be acceptable. However, in a high-performance networking application - which, let's be honest, isn't a common project for most - it could be significant.
> Last week, Sweeney noticed he couldn't locate Musk's jet, and realized Musk was attempting to hide his flight patterns from the @ElonJet using the blocking software Sweeney had recommended to him.
Source: https://techxplore.com/news/2022-05-college-student-tracks-e...
[1]: https://forums.macrumors.com/threads/macbook-pro-m1-max-almo...
Only after building it I realized that there could be more use-cases; for example when traveling and working from a bad connection. The pages are usually much more lightweight than the original ones and don't contain any trackers.
I don't even have metrics for that service. No idea how many people are using it and I don't care for the most part. That said, if anyone is interested in using the service you can run your own instance and be completely independent.
The code is here BTW: https://github.com/readable-app/readable.
I guess that's mostly a testament to the effectiveness of caching. My guess is that 95% (maybe more?) of all the traffic on SO is read-only. A caching-layer like Varnish/Nginx would be performant in front of any backend. We used to have a similar amount of traffic with PHP in the backend and it was just fine.
Fully agree with the rest of the post, though. Keep it simple.