diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2022-08-26 14:08:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-26 14:08:47 +0200 |
| commit | 378f851e95b706701af64de4c80f655b9654661c (patch) | |
| tree | 32fdee552c9337421e0078e80e6251661dd90be2 /compiler/rustc_codegen_llvm/src/common.rs | |
| parent | 7881e0576b5462ebb1f3468f049fc810857e8c69 (diff) | |
| parent | 38eb33b305bb7ac5203704b6e09fab7b9829a4c0 (diff) | |
| download | rust-378f851e95b706701af64de4c80f655b9654661c.tar.gz rust-378f851e95b706701af64de4c80f655b9654661c.zip | |
Rollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddle
Reduce right-side DOM size
This is another follow-up of https://github.com/rust-lang/rust/pull/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](https://rustdoc.crud.net/imperio/reduce-rightsize-dom-size/gtk4/prelude/trait.WidgetExt.html).
r? `@notriddle`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
0 files changed, 0 insertions, 0 deletions
