rust-lang / rust-lang/rust

Rustdoc: Very long doc compile times (95%+ taken by render_html)

Open
#132,775 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-optimization I-compiletime S-needs-repro T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I've recently tried to build rustdocs in one of our projects, and I've noticed some very odd 1h+ compile times for the docs (see the attached profile) with a majority of the time taken by the render_html item in the flamegraph. Also, during that time only a single core is pinned to 100%, even though multiple cores are available. (I don't know if rustdoc is multithreaded in that stage so if it is not that should be as expected)

My question now is: Is this expected behavior? If not, or if you need more information, I can try to create a minimum example that is able to reproduce this issue if that is something someone wants :)

Image

prof file

(since the .mm_profdata file is too big I uploaded it to google drive instead :) )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the attached flamegraph and .mm_profdata profile, focusing on rustdoc's render_html stage. Reproduce the report with a minimized example if possible, then determine whether the long compile time and single-core usage are expected. Done means a confirmed diagnosis with a targeted fix or documented explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.