Comparison of Rust async and Linux thread context switch time and memory use

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Sevalla - Deploy and host your apps and databases, now with $50 credit!
Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!
sevalla.com
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
  1. FrameworkBenchmarks

    Source for the TechEmpower Framework Benchmarks project

    > A context switch takes around 0.2µs between async tasks, versus 1.7µs between kernel threads. But this advantage goes away if the context switch is due to I/O readiness: both converge to 1.7µs.

    This is a big surprise.

    If you look at the Techempower web benchmark [1], the performance of actix-web is about 20x higher than that of Rocket.

    The common explanation is that actix-web is async and hence much faster than Rocket which relies on kernel context switching.

    But if Rust async and kernel thread has the same switch time as shown by this benchmark, then why is actix-web so much faster than Rocket?

    [1] https://www.techempower.com/benchmarks/#section=data-r20&hw=...

  2. Sevalla

    Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!

    Sevalla logo
  3. tigerbeetle

    Discontinued A distributed financial accounting database designed for mission critical safety and performance. [Moved to: https://github.com/tigerbeetledb/tigerbeetle] (by coilhq)

    Not Rust, but you may be interested in colorless async io_uring using Zig: https://news.ycombinator.com/item?id=26111847

    Also (very rough) benchmarks (take with a pinch of salt) comparing various styles of fs and network IO (blocking, epoll, io_uring) for C and Zig: https://github.com/coilhq/tigerbeetle/tree/master/demos/io_u...

  4. context-switch

    Comparison of Rust async and Linux thread context switch time.

  5. async-std

    Async version of the Rust standard library

    Nothing so fancy.

    Each worker thread runs in a loop executing a queue of jobs. On every iteration it sets an atomic progress flag to true.

    The runtime in which it's contained polls its workers every 1-10ms, atomically swapping in false and checking to see if the previous value was also false - if so, it steals its task queue and spins up another worker to execute it.

    https://github.com/async-rs/async-std/blob/ceba324bef9641d61...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Show HN: Ohkami v0.24 – A runtime-flexible web framework for Rust

    1 project | news.ycombinator.com | 29 Aug 2025
  • How to Read Data from PostgreSQL with Diesel in Rust?

    1 project | dev.to | 11 May 2025
  • Why choose async/await over threads?

    11 projects | news.ycombinator.com | 25 Mar 2024
  • Async Rust: Cooperative vs Preemptive scheduling

    3 projects | dev.to | 16 Sep 2022
  • What are the side-effects of using different runtimes in the same codebase?

    2 projects | /r/rust | 21 Feb 2022