← Retour au blog
tech 29 August 2026

How I Made Rustdoc 33% Faster in One Week

Learn how a series of PRs reduced Rustdoc's processing time by 33%, turning a bug into a significant improvement for Rust developers.

Article inspired by the original source
How I made Rustdoc 33% faster in one week ↗ noahlev.org

Introduction

As a member of the Rustdoc team, I recently executed a series of pull requests (PRs) that significantly improved Rustdoc's performance, achieving an average wall-time reduction of 25% and up to 40% for certain libraries like hyper and bitmaps. In this article, I will share how I discovered and implemented these performance improvements.

The Initial Bug

It all started with a peculiar bug reported by @theemathas from the Rust release team. During tests of the new beta version with the Crater tool, an issue was found with a crate called indented-blocks. Rustdoc failed with a "reached the configured maximum number of stack frames" error, whereas Rustc successfully compiled the code.

Analysis and Diagnosis

Rustdoc often leverages Rustc APIs to organize and present information. I discovered that Rustdoc was unnecessarily trying to inline documentation for an internal trait in core::fmt, which was not needed for a nearly empty crate. Upon examining the logs, it became clear that Rustdoc was attempting to inline superfluous documentation.

Optimization and Implementation

To tackle this issue, I started by optimizing how Rustdoc handles the inlining of traits. By restricting this feature to necessary elements, we significantly reduced processing time. I also made changes to enhance the caching mechanism, further speeding up the process.

Results

Following these improvements, Rustdoc exhibited a 33% average reduction in processing time, reaching up to 60% on certain microbenchmarks like helloworld. These enhancements not only resolved the initial bug but also provided a better experience for Rustdoc users.

Conclusion

This experience was a lesson in the importance of thorough bug analysis and how a methodical approach can lead to significant improvements. If you're interested in optimizing your tech tools, let's discuss your project in 15 minutes.

Sources

  • [Rustdoc Documentation](https://doc.rust-lang.org/rustdoc/)
  • [Noah Lev Bartell-Mangel's Blog](https://noahlev.org/blog/2026/08/27/making-rustdoc-faster/)
Rustdoc performance optimization Rust development
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call