Repository navigation
Commit b255ecd
authored
Rollup merge of #162976 - xonx4l:rustdoc-sidebar-quadratic, r=lolbinarycat,GuillaumeGomez
fix quadratic naming of duplicate sidebar links
This PR fixes quadratic naming of duplicate sidebar links as discussed in #158174.
Fixes #158174
`get_next_url` gives duplicate sidebar links with unique names but it started counting from 1 every time which makes the page quadratic.
So to make it more optimal I changed that to remember the next unique number for each name making it linear per page.
Also added the test at `tests/rustdoc-html/deref/sidebar-links-deref-chain.rs`
### Results
| N | Instructions (before) | Instructions (after) | Time (before) | Time (after) |
|-----:|----------------------:|---------------------:|--------------:|-------------:|
| 200 | 5.71 B | 3.69 B | 1.20 s | 1.01 s |
| 400 | 22.40 B | 9.52 B | 3.79 s | 1.98 s |
| 800 | 126.83 B | 30.82 B | 19.68 s | 6.04 s |
| 1600 | — | — | 118.59 s | 37.76 s |
r? @GuillaumeGomez2 files changed
Lines changed: 35 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
757 | 756 | | |
758 | 757 | | |
759 | 758 | | |
| |||
764 | 763 | | |
765 | 764 | | |
766 | 765 | | |
767 | | - | |
| 766 | + | |
768 | 767 | | |
769 | 768 | | |
770 | 769 | | |
| |||
802 | 801 | | |
803 | 802 | | |
804 | 803 | | |
805 | | - | |
| 804 | + | |
806 | 805 | | |
807 | 806 | | |
808 | 807 | | |
| |||
820 | 819 | | |
821 | 820 | | |
822 | 821 | | |
823 | | - | |
| 822 | + | |
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments