Skip to content
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

rustdoc: Merge source code pages HTML elements together v2 #100775

Merged
merged 5 commits into from
Aug 21, 2022

Conversation

GuillaumeGomez
Copy link
Member

This is the follow-up of #100429.

I strongly recommend to review it one commit at a time because otherwise it's a lot at once.

For these ones, on each page, I run this JS: document.getElementsByTagName('*').length. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs.

file name before #100429 before this PR with this PR diff
std/lib.rs.html (source link on std crate page) 3455 2332 1772 24%
alloc/vec/mod.rs.html (source on Vec type page) 11012 5982 5833 2.5%
alloc/string.rs.html (source on String type page) 10800 6010 5822 3.2%
std/sync/mutex.rs.html (source on Mutex type page) 2953 2041 2038 0.1%

So unsurprisingly, the more attributes you have, the bigger the difference.

You can test it here.

cc @jsha
r? @notriddle

@GuillaumeGomez GuillaumeGomez added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Aug 19, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2022
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
src/librustdoc/html/highlight.rs Show resolved Hide resolved
src/librustdoc/html/highlight.rs Show resolved Hide resolved
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
src/librustdoc/html/highlight.rs Outdated Show resolved Hide resolved
@GuillaumeGomez
Copy link
Member Author

I applied your suggestions. Thanks a lot for them!

@GuillaumeGomez
Copy link
Member Author

Did you see something else missing @notriddle ?

@notriddle
Copy link
Contributor

Not really.

@bors r+

@bors
Copy link
Contributor

bors commented Aug 20, 2022

📌 Commit 7ab8e0c has been approved by notriddle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 20, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…otriddle

rustdoc: Merge source code pages HTML elements together v2

This is the follow-up of rust-lang#100429.

I strongly recommend to review it one commit at a time because otherwise it's a lot at once.

For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs.

| file name | before rust-lang#100429 | before this PR | with this PR | diff |
|-|-|-|-|-|
| std/lib.rs.html (source link on std crate page) | 3455 | 2332 | 1772 | 24% |
| alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 5982 | 5833 | 2.5% |
| alloc/string.rs.html (source on String type page) | 10800 | 6010 | 5822 | 3.2% |
| std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2041 | 2038 | 0.1% |

So unsurprisingly, the more attributes you have, the bigger the difference.

You can test it [here](https://rustdoc.crud.net/imperio/reduce-span-v2/src/std/lib.rs.html).

cc `@jsha`
r? `@notriddle`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…otriddle

rustdoc: Merge source code pages HTML elements together v2

This is the follow-up of rust-lang#100429.

I strongly recommend to review it one commit at a time because otherwise it's a lot at once.

For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs.

| file name | before rust-lang#100429 | before this PR | with this PR | diff |
|-|-|-|-|-|
| std/lib.rs.html (source link on std crate page) | 3455 | 2332 | 1772 | 24% |
| alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 5982 | 5833 | 2.5% |
| alloc/string.rs.html (source on String type page) | 10800 | 6010 | 5822 | 3.2% |
| std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2041 | 2038 | 0.1% |

So unsurprisingly, the more attributes you have, the bigger the difference.

You can test it [here](https://rustdoc.crud.net/imperio/reduce-span-v2/src/std/lib.rs.html).

cc ``@jsha``
r? ``@notriddle``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…otriddle

rustdoc: Merge source code pages HTML elements together v2

This is the follow-up of rust-lang#100429.

I strongly recommend to review it one commit at a time because otherwise it's a lot at once.

For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs.

| file name | before rust-lang#100429 | before this PR | with this PR | diff |
|-|-|-|-|-|
| std/lib.rs.html (source link on std crate page) | 3455 | 2332 | 1772 | 24% |
| alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 5982 | 5833 | 2.5% |
| alloc/string.rs.html (source on String type page) | 10800 | 6010 | 5822 | 3.2% |
| std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2041 | 2038 | 0.1% |

So unsurprisingly, the more attributes you have, the bigger the difference.

You can test it [here](https://rustdoc.crud.net/imperio/reduce-span-v2/src/std/lib.rs.html).

cc ```@jsha```
r? ```@notriddle```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…otriddle

rustdoc: Merge source code pages HTML elements together v2

This is the follow-up of rust-lang#100429.

I strongly recommend to review it one commit at a time because otherwise it's a lot at once.

For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs.

| file name | before rust-lang#100429 | before this PR | with this PR | diff |
|-|-|-|-|-|
| std/lib.rs.html (source link on std crate page) | 3455 | 2332 | 1772 | 24% |
| alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 5982 | 5833 | 2.5% |
| alloc/string.rs.html (source on String type page) | 10800 | 6010 | 5822 | 3.2% |
| std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2041 | 2038 | 0.1% |

So unsurprisingly, the more attributes you have, the bigger the difference.

You can test it [here](https://rustdoc.crud.net/imperio/reduce-span-v2/src/std/lib.rs.html).

cc ````@jsha````
r? ````@notriddle````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 21, 2022
…otriddle

rustdoc: Merge source code pages HTML elements together v2

This is the follow-up of rust-lang#100429.

I strongly recommend to review it one commit at a time because otherwise it's a lot at once.

For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs.

| file name | before rust-lang#100429 | before this PR | with this PR | diff |
|-|-|-|-|-|
| std/lib.rs.html (source link on std crate page) | 3455 | 2332 | 1772 | 24% |
| alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 5982 | 5833 | 2.5% |
| alloc/string.rs.html (source on String type page) | 10800 | 6010 | 5822 | 3.2% |
| std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2041 | 2038 | 0.1% |

So unsurprisingly, the more attributes you have, the bigger the difference.

You can test it [here](https://rustdoc.crud.net/imperio/reduce-span-v2/src/std/lib.rs.html).

cc `````@jsha`````
r? `````@notriddle`````
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 21, 2022
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#100556 (Clamp Function for f32 and f64)
 - rust-lang#100663 (Make slice::reverse const)
 - rust-lang#100697 ( Minor syntax and formatting update to doc comment on `find_vtable_types_for_unsizing`)
 - rust-lang#100760 (update test for LLVM change)
 - rust-lang#100761 (some general mir typeck cleanup)
 - rust-lang#100775 (rustdoc: Merge source code pages HTML elements together v2)
 - rust-lang#100813 (Add `/build-rust-analyzer/` to .gitignore)
 - rust-lang#100821 (Make some docs nicer wrt pointer offsets)
 - rust-lang#100822 (Replace most uses of `pointer::offset` with `add` and `sub`)
 - rust-lang#100839 (Make doc for stdin field of process consistent)
 - rust-lang#100842 (Add diagnostics lints to `rustc_transmute` module (zero diags))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5518b6b into rust-lang:master Aug 21, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 21, 2022
@GuillaumeGomez GuillaumeGomez deleted the reduce-span-v2 branch August 22, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants