Closed Bug 1521787 Opened 5 years ago Closed 5 years ago

Recent Rust rustdoc hang regression much worse in Firefox than in Chromium

Categories

(Core :: JavaScript Engine, defect)

64 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Performance Impact ?

People

(Reporter: MTest31, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

In recent Rust nightlies, rustdoc generation has been changed to minify the javascript of search-index.js 1. This had negative performance consequences onto performance of loading of rustdoc sites, both in Chromium, and in Firefox.

The reason why I'm filing a bug for Firefox as well as reporting it to rustdoc developers 2 is because Firefox performance on the sites is much slower than Chromium, to unbearable levels. Even if the rustdoc bug itself is fixed, it might be interesting to fix the underlying issue in Firefox.

The bug gets worse the more complex the project that is being documented is. The effect is already visible in the official Rust documentation as outlined in 2, but it's much much stronger in a medium-sized local project of mine, and makes browsing servo docs on Firefox impossible. I'd say 3 minutes load time definitely fall into the category of "impossible".

The "TTL" value is the pink/red value at the bottom in the network tab of Firefox/Chrome developer tools after issuing a Ctrl+shift+R event.

Example name | search-index.js size | TTL Firefox | TTL Chrome

stable core | 1.96 MB | 554 ms | 326 ms
nightly core | 1.16 MB | 1.26 s | 400 ms
Local project | 4.36 MB | 8.99 s | 1.12 s
servo new rustdoc | 18.65 MB | 3.07 min | 5.02 s
servo old rustdoc | 23.03 MB | 3.32 s | 2.41 s

The search-index.js size column shows the uncompressed size that Firefox has to parse, not the amount of bytes that were sent over the wire.

URL used for the stable core docs: https://doc.rust-lang.org/1.32.0/core/index.html

URL used for the nightly core docs: https://doc.rust-lang.org/nightly/core/index.html

Documentation of servo with the pre-regression rustdoc is hosted at: https://doc.servo.org/servo/index.html

Reproduction for the "servo new rustdoc" row:

  1. git clone https://github.com/servo/servo && cd servo
  2. git checkout c3608c0cb581cc055e98605d38540769e28949d1
  3. Update the rustc version used as servo currently has a nightly from before the regression: echo "nightly-2019-01-21" > rust-toolchain
  4. Run ./mach doc (this is going to take a while)
  5. Run python -m SimpleHTTPServer
  6. Navigate the browser to http://localhost:8000/target/doc/servo/index.html

Firefox used: Firefox 64.0

Flags: needinfo?(jdemooij)
Whiteboard: [qf]

Huh, I got that markdown table wrong. This is a fixed version:

Example name search-index.js size TTL Firefox TTL Chrome
stable core 1.96 MB 554 ms 326 ms
nightly core 1.16 MB 1.26 s 400 ms
Local project 4.36 MB 8.99 s 1.12 s
servo new rustdoc 18.65 MB 3.07 min 5.02 s
servo old rustdoc 23.03 MB 3.32 s 2.41 s

Mind trying this with Firefox Nightly? It's much faster than Firefox 64 on the local "servo new rustdoc" page.

Flags: needinfo?(jdemooij)

So I've tried it, and indeed, Firefox Nightly is much faster than 64 in the local "servo new rustdoc" page. This is so awesome, didn't know that such great performance improvements were coming my way!

The updated table:

Example name search-index.js size TTL Firefox 64.0 TTL Firefox Nightly TTL Chrome
stable core 1.96 MB 554 ms 382 ms 326 ms
nightly core 1.16 MB 1.26 s 465 ms 400 ms
Local project 4.36 MB 8.99 s 5.82 s 1.12 s
servo new rustdoc 18.65 MB 3.07 min 3.38 s 5.02 s
servo old rustdoc 23.03 MB 3.32 s 2.58 s 2.41 s

I'd love to say now that the issue is fixed (at least in Nightly), but there is still one test case left where Firefox is slower than Chrome, which is the local project.
It's a bit weird because it has less crates than servo.
I'd love to give you access. We can talk over IRC PM.

Ok so I restarted Firefox Nightly and now I can't reproduce the 5.82s for the local project any more, it's a few hundred ms now (771 ms in one run).

I'd say it's fixed and Firefox is sometimes even faster than Chrome. Thank you!

On the request of jandem, I've attached a profile of the local project on Firefox 64.

Great! This probably got fixed by bug 1517135. It's hard to say because the profile doesn't include C++ code, but a lot of time under "script emit" so it's very likely.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Depends on: 1517135
Resolution: --- → FIXED
Performance Impact: --- → ?
Whiteboard: [qf]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: