-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huge performance regression in rustdoc between 1/28 and 2/25 nightlies #58849
Comments
Looks like the doc generation used to take 6m 28s. |
Never mind, that pass is present in the 1/28 nightly. |
It looks like the number of patches landing in master between those two nightlies is actually fairly small when constraining to just src/librustdoc. I might have messed this up though. f573049 Auto merge of #58232 - ljedrz:HirIdification_continued, r=Zoxc |
It's very certainly because of my minification process. Although, I didn't expect it to have a noticeable impact... |
The only minifier change that landed into rustdoc between those dates was #57884. The minifier was actually in place before then. |
This may actually be a regression in quote/proc-macro2. I'm not yet sure if this is the thing causing long doc builds (some things in our server build history disagree with this hypothesis), but our mozjs_sys crate hits a ton of intra-doc-links failures in jsapi.rs, a bindgen-generated file. Normally this is fine, but on some versions of proc-macro2 bindgen is outputting a file that's basically a single giant line (+ some headers). The intra doc link failures have a field day with this, printing out the entire (already giant) file for each warning. There are a lot of such warnings because the autogenerated documentation has things like |
I've narrowed down the regression range to between 2019-02-07 and 2019-02-10 |
No, the mozjs_sys issues are not the problem. They started becoming a problem at some point, but the commit that did the rust upgrade does not have a giant log, and still takes 55minutes to build |
These are all the PRs landing in master in that range d173180 Auto merge of #58266 - GuillaumeGomez:rollup, r=GuillaumeGomez The first rollup contains a lot of rustdoc PRs. |
Confirmed, the perf regression is inside #58266 |
The regression is caused by #57884 cc @GuillaumeGomez Unsure what's casing it so far. |
I suspect it's just that we have some truly giant crates (see https://doc.servo.org/script/) and we're hitting some pathological case |
The problem is that I currently re-read the JS a few times. It's worth taking a look at this giant crate now to see how I can improve it (I never focused on speed for it after all). |
@GuillaumeGomez Is the number of times you reread the JS dependent on the size of the crate? I'm not yet sure if it is indeed this crate causing this problem, but the crate in question is Servo's script crate. It may also just be the sum total of all the crates being slow. |
Potentially. I'll take a look as soon as I can. |
It seems like the filesize for the generated docs is also just huge. It took forever to delete |
Nope, they're roughly the same size. |
And what the rendering time difference? |
--disable-minification takes a couple minutes, without it it takes 70 |
Move docs build back into tidy+unit builder, disable minification According to rust-lang/rust#58849 the rustdoc performance regression is due to a minification change. Disabling minification fixes it temporarily. Minification is a decent chunk of execution time for us even for normal doc builds so we may actually want to just keep it this way. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23014) <!-- Reviewable:end -->
With https://doc.servo.org/script/?search=websocket gives
|
I think I've run into this too, I'm seeing a 3x slowdown for an embedded crate (pretty full of generated code). In case this is a useful repro case:
Edit: This is specifically a stable-to-stable perf regression between 1.33.0 and 1.34.0. |
Also seeing a large performance regression from 1.33.0 to 1.34.0 in Rusoto. We document a lot of crates (146 right now) and documentation job time went from 16 minutes to timing out at more than 50 minutes. Our current workaround is to use 1.33.0 to document our code. This will stop working as soon as we adopt anything from the 1.34.0 release. Anything we can test to help fix this? |
Can we revert the minification update PR? @GuillaumeGomez |
@Manishearth It made a first performance improvement. Removing it doesn't seem to be a good idea... |
I took a flamegraph of the problematic sections of I ran
Specifically,
In this whole call stack, almost all time is spent in the bottom item. |
@GuillaumeGomez I don't understand what you mean by that comment. If it made an improvement but also had extremely adverse effects on some crates, it should be fixed or reverted. That's not a performance improvement. |
@Manishearth: I meant by my comment that the situation was worse before my last changes. @jamesmunns: Thanks! That'll help me a lot! |
From my measurements on servo and the other measurement in this thread, this is definitely not universally true, and the cases where it's not true it's super bad. |
Strange since I removed a few iterations over the full JS tokens... I'll check soon. |
Any updates on this? I think we should do a more careful performance measurement here, perf updates that make things worse for a lot of crates should be done carefully. |
I believe the plan is to remove minification entirely, as discussed in #56359. |
Or at least on the |
Was this fixed by #66828? |
At least with a relevantly recent nightly, this is back down to within the rough area of 1.33.0.
|
I guess it can be closed then! |
Disable isn't possible for non-nightly versions of Rust, so this is currently breaking the doc build. In addition, it seems that the original issue that triggered this change [^1] is now fixed. [^1]: rust-lang/rust#58849
Disable isn't possible for non-nightly versions of Rust, so this is currently breaking the doc build. In addition, it seems that the original issue that triggered this change [^1] is now fixed. [^1]: rust-lang/rust#58849
Disable isn't possible for non-nightly versions of Rust, so this is currently breaking the doc build. In addition, it seems that the original issue that triggered this change [^1] is now fixed. [^1]: rust-lang/rust#58849
Disable isn't possible for non-nightly versions of Rust, so this is currently breaking the doc build. In addition, it seems that the original issue that triggered this change [^1] is now fixed. [^1]: rust-lang/rust#58849
When using the 1/28 Rust nightly for a Servo CI job on linux, the job that does a variety of builds and unit tests as well as generates docs for every single dependency took 20 minutes total. After updating to the 2/25 nightly, just the doc generation by itself takes 37 minutes, often causing our CI limit of 60 minutes to be exceeded.
The text was updated successfully, but these errors were encountered: