tokio
smol
tokio | smol | |
---|---|---|
223 | 9 | |
29,088 | 4,324 | |
1.5% | 2.8% | |
9.5 | 5.3 | |
5 days ago | about 2 months ago | |
Rust | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tokio
-
Persistent Storage and 97% Faster Cold Starts for Edge Functions
Previously, Edge Functions with large dependencies or doing preparation work at the start (e.g., parsing/loading configs, initializing AI models) would incur a noticeable boot delay. Sometimes, these slow neighbors can impact other functions running on the same machine. All JavaScript workers in the Supabase Edge Functions Runtime were cooperatively scheduled on the same Tokio thread pool. If one worker had heavy startup logic, such as parsing JavaScript modules or running synchronous operations, it could delay every worker scheduled after. This led to occasional long‑tail latency spikes in high-traffic projects. To address this issue, we moved workers which are still performing initial script evaluation onto a dedicated blocking pool. This approach prevents heavy initialization tasks from blocking the Tokio thread, significantly reducing boot time spikes for other functions.
-
Why doesn't Rust care more about compiler performance?
docs.rs is just barely viable because it only has to build crates once (for one set of features, one target platform etc.).
What you propose would 1) have to build each create for at least the 8 Tier 1 targets, if not also the 91 Tier 2 targets. That would be either 8 or 99 binaries already.
Then consider that it's difficult to anticipate which feature combinations a user will need. For example, the tokio crate has 14 features [1]. Any combination of 14 different features gives 2^14 = 16384 possible configurations that would all need to be built. Now to be fair, these feature choices are not completely independent, e.g. the "full" feature selects a bunch of other features. Taking these options out, I'm guessing that we will end up with (ballpark) 5000 reasonable configurations. Multiply that by the number of build targets, and we will need to build either 40000 (Tier 1 only) or 495000 binaries for just this one crate.
Now consider on top that the interface of dependency crates can change between versions, so the tokio crate would either have to pin exact dependency versions (which would be DLL hell and therefore version locking is not commonly used for Rust libraries) or otherwise we need to build the tokio crate separately for each dependency version change that is ABI-incompatible somewhere. But even without that, storing tens of thousands of compiled variants is very clearly untenable.
Rust has very clearly chosen the path of "pay only for what you use", which is why all these library features exist in the first place. But because they do, offering prebuilt artifacts is not viable at scale.
[1] https://github.com/tokio-rs/tokio/blob/master/tokio/Cargo.to...
-
A Journey From JS To Rust
Currently, the de facto standard async runtime is tokio. Beginners can just use tokio without much thought.
-
Exploring the top Rust web frameworks
Gotham is a flexible web framework built for stable Rust that promotes “stability, safety, security, and speed.” It provides async support with the help of Tokio and hyper out of the box.
-
Building a simple Kubernetes Controller in Rust - Part 1
Because of the nature of Kubernetes and its operation being "network operations", kube-rs considers all the operations as "async" operations, and we need a way to manage it. The well-known and mostly used way of doing it is with the tokio framework. Adding tokio, with features of "macros" (to use macros like #[tokio::main]) and a runtime (rt-multi-thread) should be enough. Additionally, we need to return an error to this function, so we will be using anyhow crate, that allows us to return errors without worrying about the error type
- Why I'm Writing a Scheme Implementation in 2025 (The Answer Is Async Rust)
-
The Inevitability of the Borrow Checker
The situation in Rust seems to be pretty complicated. But I did find that panicking within a thread you spawn kills just that thread and not the whole program. And it seems that Tokio has the same behavior.
https://github.com/tokio-rs/tokio/issues/2002
And web frameworks like Tower provide standard ways of Helen’ handling panics and turning them into error responses.
https://docs.rs/tower-http/latest/tower_http/catch_panic/ind...
So I don’t think panics are necessarily meant to be program-killing in Rust, even if Result types are heavily recommended instead.
-
Zig; what I think after months of using it
There's compiler-level traits like `Iterator` and `Future` which enforce references. If wanting to do intrusive pointers into them, one risks creating overlapping references: https://github.com/tokio-rs/tokio/issues/3399
- Build It Yourself
-
Rusty Backends
Full Tokio compatibility
smol
-
The State of Async Rust
My understanding is you always need a runtime, somethings needs to drive the async flow. But there are others on the market, just not without the.. market domination... of tokio.
https://github.com/smol-rs/smol looks promising simply for being minimal
https://github.com/bytedance/monoio looks potentially easier to work with than tokio
https://github.com/DataDog/glommio is built around linux io_uring and seems somewhat promising for performance reasons.
I haven't played with any of these yet, because Tokio is unfortunately the path of least resistance. And a bit viral in how it's infected tings.
- Smol: A small and fast async runtime for Rust
-
Tokio for FFI app?
There is also https://github.com/smol-rs/smol which has components which you can compose into your own executor if you still need async IO but your usage patterns don't fit into the general purpose ones that Tokio provides.
-
Tokio application structure, critical code flow.
If you need precise control over scheduling, consider building something on top of https://github.com/smol-rs/smol
- Async Rust: What is a runtime? Here is how tokio works under the hood
-
18 factors powering the Rust revolution, Part 2 of 3
Tokio is a "take what you need" framework, whilst Async-std started as an "everything the box" solution. Today both have a lot of crossover with micro async runtimes like smol becoming the foundation one of framework and optionally usable in the other. The ability to rip out a small dependent sub-crate (dependent package) like smol and use it independently with ease never get's boring, by the way. It's great way to include a test runtime in an async library without forcing the inclusion of a giant async framework.
-
[Question] Is Tokio a poor fit for non-network related concurrent applications?
Helix uses tokio. smol might be a good alternative however.
-
Async feedback from 2 years of usage
No, still active on GitHub. What gave you that idea? https://github.com/smol-rs/smol
-
Tokio, the async runtime for Rust, hits 1.0
Found the issue in Google cache. I'm not sure it's really fair of me to post this link here, but equally I think it's better to give the actual text rather than leave it vague.
https://webcache.googleusercontent.com/search?q=cache:PRjMyv...
What are some alternatives?
futures-rs - Zero-cost asynchronous programming in Rust
async-std - Async version of the Rust standard library
bastion - Highly-available Distributed Fault-tolerant Runtime
iced - A cross-platform GUI library for Rust, inspired by Elm
reqwest - An easy and powerful Rust HTTP Client