A high-profile case study from TikTok demonstrates Rust's significant impact on operational costs, showing a $300,000 annual saving by rewriting a Go service. The project also slashed P99 latency by a massive 76% for their high-throughput payment system.
This real-world example provides powerful evidence for Rust's value in optimizing stable, CPU-intensive services. Does this signal a growing trend for companies to strategically rewrite high-cost components for massive efficiency gains?
In today’s Rust recap:
> TikTok's $300K cost savings after a Go-to-Rust rewrite
> New Rust I2C drivers and toolchain updates land in the Linux kernel
> A subtle footgun in fs::write that can silently drop errors
> Walrus, a new streamer hitting 1.2M writes/sec with io_uring
TikTok's $300K Rust Bet
The Recap: A TikTok team rewrote a high-throughput Go payment service in Rust, slashing P99 latency by 76% and cutting annual compute costs by over $300,000. This project highlights Rust's efficiency for optimizing stable, CPU-intensive services at scale.
Unpacked:
The team used a gradual rollout by deploying the Rust version on separate clusters under the same service name, which meant no upstream code changes were needed.
Key technical challenges included adapting Go's zero-value patterns to Rust's stricter
Optionenum and carefully optimizing memory allocations for peak performance.The main takeaway is that Rust is ideal for high-usage, stable components where the initial investment in developer productivity is justified by massive economies of scale.
Bottom line: This case study provides a powerful, real-world example of Rust's value in high-throughput systems. The results demonstrate how targeted rewrites can yield substantial financial and performance returns for stable, CPU-bound services.
Kernel Gets More Rust
The Recap: The upcoming Linux 6.19 kernel is set to introduce new Rust bindings for writing I2C drivers, and the project will now align its minimum supported Rust compiler with Debian Stable releases.
Unpacked:
The groundwork for I2C support includes the core abstractions, an API for device registration, and helpful sample drivers to guide developers.
The new toolchain policy will follow Debian Stable, giving kernel developers a more stable and predictable upgrade path for the Rust toolchain.
Core infrastructure updates also include adding support for the popular Syn parsing library to process streams of Rust tokens into a syntax tree.
Bottom line: These updates continue to solidify Rust's role as a practical and maturing option for kernel development. The new versioning policy, in particular, provides developers with much-needed stability and a clear roadmap for contributing.
The File Write Footgun
The Recap:A subtle issue in Rust's standard library has gained attention, revealing that fs::write can silently discard critical errors when closing files. This behavior creates a risk of silent data loss, especially on certain filesystems.
Unpacked:
The problem is most critical on network filesystems like NFS, which may only report write failures during the final close operation, not during the initial write calls.
This happens because the error occurs when the
Filehandle is dropped, and the design of Rust'sDroptrait does not allow it to return aResult.The discovery has sparked discussion because it runs counter to Rust's reputation for rigorous error handling and preventing silent failures.
Bottom line: This situation is a valuable reminder of how subtle interactions with underlying system APIs can introduce unexpected risks. The active community discussion highlights a strong commitment to improving Rust's correctness at every level.
A Kafka-Like at 1.2M Writes/Sec
The Recap: A new, open-source message streamer built in Rust, called Walrus, is demonstrating impressive performance with a claimed 1.2 million writes per second on a single node. The project achieves this speed by using a custom-built storage engine and modern I/O APIs.
Unpacked:
The custom storage engine leverages
io_uringfor batched writes on Linux, providing a significant performance boost over traditional system calls.Its distributed design cleverly uses Raft for metadata only, ensuring that the high-throughput data path is not slowed by consensus protocols.
For developers who don't need a full cluster, the project's core can be used as a standalone storage engine for fast local logging.
Bottom line: Walrus is a great showcase of how Rust can be used to build highly-optimized infrastructure from the ground up. It represents a growing trend of developers creating specialized, high-performance alternatives to established systems.
The Shortlist
Typhon aims to compile Python into standalone native binaries, leveraging Rust and LLVM to enforce static typing and eliminate the need for an interpreter.
Fresh launched as a new terminal-based text editor built to handle huge files with minimal memory, offering modern features like a native LSP client and multi-cursor support.
Mutation testing is gaining traction with cargo-mutants, a tool that helps find gaps in test suites by deliberately inserting bugs, as showcased in a recent analysis of the librsvg library.
Debate surrounds a proposal to change the default mutex lock-poisoning behavior, sparking discussion on how to best handle state consistency when panics occur in critical sections.
