Skip to content

Reduce right-side DOM size #100956

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Aug 26, 2022

Conversation

GuillaumeGomez
Copy link
Member

This is another follow-up of #100429 but not in code blocks this time.

So the idea is: if there is only one element in the .rightside element, there is no need to wrap it, we can just create one node.

On each page, I run this JS: document.getElementsByTagName('*').length. Important to note: the bigger the number of elements inside the page, the greater the gain. It also doesn't work very nicely on std docs because there are a lot of version annotations. So with this PR, It allows to get the following results:

file name before this PR with this PR diff
std/default/trait.Default.html 2189 1331 39.2%
std/vec/struct.Vec.html 14073 13842 1.7%
std/fmt/trait.Debug.html 5313 4907 7.7%
std/ops/trait.Index.html 642 630 1.9%
gtk4/WidgetExt 3269 3061 6.4%

You can test it here.

r? @notriddle

@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 24, 2022
@rustbot
Copy link
Collaborator

rustbot commented Aug 24, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

A change occurred in the Ayu theme.

cc @Cldfire

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2022
@GuillaumeGomez GuillaumeGomez force-pushed the reduce-rightside-dom-size branch from 995586a to 38eb33b Compare August 24, 2022 18:25
@GuillaumeGomez
Copy link
Member Author

Fix the bad double call and extended GUI tests.

@notriddle
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 25, 2022

📌 Commit 38eb33b 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 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 26, 2022
…llaumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#95005 (BTree: evaluate static type-related check at compile time)
 - rust-lang#99742 (Add comments about stdout locking)
 - rust-lang#100128 (Document that `RawWakerVTable` functions must be thread-safe.)
 - rust-lang#100956 (Reduce right-side DOM size)
 - rust-lang#101006 (Fix doc cfg on reexports)
 - rust-lang#101012 (rustdoc: remove unused CSS for `.variants_table`)
 - rust-lang#101023 (rustdoc: remove `type="text/css"` from stylesheet links)
 - rust-lang#101031 (Remove unused build dependency)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Aug 26, 2022

☔ The latest upstream changes (presumably #101037) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 26, 2022
@bors bors merged commit 378f851 into rust-lang:master Aug 26, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 26, 2022
@Kobzol
Copy link
Contributor

Kobzol commented Aug 26, 2022

Doc size wins from the rollup where this PR was merged (probably coming mostly from this PR): https://perf.rust-lang.org/compare.html?start=8a13871b69924b74cfa1d737f2894068b37ea7ea&end=42fa8ac7236f4f78a82aeea543bdd445a59f02e0&stat=size%3Adoc_bytes

@GuillaumeGomez GuillaumeGomez deleted the reduce-rightside-dom-size branch August 26, 2022 22:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

6 participants