# Why is rustdoc from nightly 1.6x faster than my build from master

**URL:** <https://internals.rust-lang.org/t/why-is-rustdoc-from-nightly-1-6x-faster-than-my-build-from-master/6503>\
**Category:** Uncategorized\
**Created:** [January 8, 2018, 8:12pm UTC](https://internals.rust-lang.org/t/why-is-rustdoc-from-nightly-1-6x-faster-than-my-build-from-master/6503 "2018-01-08T20:12:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andjo403](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/andjo403/32/2931_2.png) [@andjo403](https://internals.rust-lang.org/u/andjo403)\
**Post date:** [January 8, 2018, 8:12pm UTC](https://internals.rust-lang.org/t/why-is-rustdoc-from-nightly-1-6x-faster-than-my-build-from-master/6503/1 "2018-01-08T20:12:30Z")

</div>

Have tried and failed to find the reason why “rustdoc --test” with the rustdoc version that I get with rustup is 1.6x (13s vs 22s) faster than the rustdoc that is built during test of rustc (./x.py test).

Have used an clean clone from master to build. Is there some config to be done in the config.toml file or is there some difference in how the two versions is built that is the “problem”?

> **test file lib.rs**
>
> ````
> /// ```
> /// let five = 5;
> ///
> /// assert_eq!(6, add_one(5));
> /// fn add_one(x: i32) -> i32 {
> /// x + 1
> /// }
> /// ```
> ... 258 times
> /// ```
> /// let five = 5;
> ///
> /// assert_eq!(6, add_one(5));
> /// fn add_one(x: i32) -> i32 {
> /// x + 1
> /// }
> /// ```
> pub fn add_one(x: i32) -> i32 {
> x + 1
> }
> 
> ````

> **cmd**
>
> ```
> andreas@Threadripper:~/tmp$ time rustdoc --test src/lib.rs
> 
> running 260 tests
> test src/lib.rs - add_one (line 1035) ... ok
> ...
> 
> test result: ok. 260 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
> 
> real	0m13,822s
> user	1m14,041s
> sys	1m35,835s
> andreas@Threadripper:~/tmp$ time /home/andreas/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test src/lib.rs
> 
> running 260 tests
> test src/lib.rs - add_one (line 1017) ... ok
> ...
> 
> test result: ok. 260 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
> 
> real	0m22,036s
> user	1m10,724s
> sys	1m49,057s
> andreas@Threadripper:~/tmp$ time RUST_TEST_THREADS=6 rustdoc --test src/lib.rs
> 
> running 260 tests
> test src/lib.rs - add_one (line 1017) ... ok
> ...
> 
> test result: ok. 260 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
> 
> real	0m10,384s
> user	0m41,044s
> sys	0m15,491s
> andreas@Threadripper:~/tmp$ time RUST_TEST_THREADS=6 /home/andreas/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test src/lib.rs
> 
> running 260 tests
> test src/lib.rs - add_one (line 1026) ... ok
> ...
> 
> test result: ok. 260 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
> 
> real	0m11,848s
> user	0m41,827s
> sys	0m17,611s
> andreas@Threadripper:~/tmp$ which rustdoc 
> /home/andreas/.cargo/bin/rustdoc
> andreas@Threadripper:~/tmp$ rustup show
> Default host: x86_64-unknown-linux-gnu
> 
> installed toolchains
> --------------------
> 
> stable-x86_64-unknown-linux-gnu
> nightly-x86_64-unknown-linux-gnu (default)
> 
> active toolchain
> ----------------
> 
> nightly-x86_64-unknown-linux-gnu (default)
> rustc 1.25.0-nightly (6828cf901 2018-01-06)
> 
> andreas@Threadripper:~/rust$ git show
> commit 6828cf90146c7fefc4ba4f16dffe75f763f2d910 (HEAD -> master)
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:29am UTC](https://internals.rust-lang.org/t/why-is-rustdoc-from-nightly-1-6x-faster-than-my-build-from-master/6503/2 "2019-03-25T08:29:28Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
