Commit f9cadb9
authored
Rollup merge of rust-lang#119756 - notriddle:notriddle/reuse-map, r=GuillaumeGomez
rustdoc-search: reuse individual types in function signatures
Because `search.js` never mutates the function signature after loading it,
they can be safely and easily reused across functions.
This change doesn't change the format of the search index.
It only changes `search.js`.
Profiler output: https://notriddle.com/rustdoc-html-demo-9/fn-signature-opti2/index.html
<table><tr><th>benchmark<th>before<th>after
<tr><th>arti<td>
```
user: 002.228 s
sys: 000.315 s
wall: 001.663 s
child_RSS_high: 315668 KiB
group_mem_high: 285948 KiB
```
<td>
```
user: 001.805 s
sys: 000.231 s
wall: 001.398 s
child_RSS_high: 235864 KiB
group_mem_high: 203056 KiB
```
<tr><th>cortex-m<td>
```
user: 000.143 s
sys: 000.035 s
wall: 000.140 s
child_RSS_high: 59168 KiB
group_mem_high: 23000 KiB
```
<td>
```
user: 000.138 s
sys: 000.031 s
wall: 000.133 s
child_RSS_high: 58944 KiB
group_mem_high: 22220 KiB
```
<tr><th>sqlx<td>
```
user: 000.792 s
sys: 000.115 s
wall: 000.536 s
child_RSS_high: 156716 KiB
group_mem_high: 122948 KiB
```
<td>
```
user: 000.824 s
sys: 000.084 s
wall: 000.535 s
child_RSS_high: 136668 KiB
group_mem_high: 101792 KiB
```
<tr><th>stm32f4<td>
```
user: 006.665 s
sys: 003.533 s
wall: 008.624 s
child_RSS_high: 1037660 KiB
group_mem_high: 1022516 KiB
```
<td>
```
user: 005.997 s
sys: 003.185 s
wall: 007.987 s
child_RSS_high: 832068 KiB
group_mem_high: 810908 KiB
```
<tr><th>stm32f4xx-hal<td>
```
user: 000.317 s
sys: 000.051 s
wall: 000.203 s
child_RSS_high: 77060 KiB
group_mem_high: 41776 KiB
```
<td>
```
user: 000.287 s
sys: 000.046 s
wall: 000.180 s
child_RSS_high: 75216 KiB
group_mem_high: 39200 KiB
```
<tr><th>ripgrep<td>
```
user: 000.463 s
sys: 000.063 s
wall: 000.295 s
child_RSS_high: 101288 KiB
group_mem_high: 66364 KiB
```
<td>
```
user: 000.472 s
sys: 000.036 s
wall: 000.247 s
child_RSS_high: 82708 KiB
group_mem_high: 47056 KiB
```
</tr></table>1 file changed
+91
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2717 | 2717 | | |
2718 | 2718 | | |
2719 | 2719 | | |
2720 | | - | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
2721 | 2723 | | |
2722 | 2724 | | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
2723 | 2747 | | |
2724 | 2748 | | |
2725 | 2749 | | |
| |||
2732 | 2756 | | |
2733 | 2757 | | |
2734 | 2758 | | |
2735 | | - | |
2736 | | - | |
| 2759 | + | |
| 2760 | + | |
2737 | 2761 | | |
2738 | 2762 | | |
2739 | 2763 | | |
2740 | 2764 | | |
2741 | 2765 | | |
2742 | 2766 | | |
2743 | | - | |
| 2767 | + | |
2744 | 2768 | | |
2745 | 2769 | | |
2746 | 2770 | | |
| |||
2759 | 2783 | | |
2760 | 2784 | | |
2761 | 2785 | | |
2762 | | - | |
| 2786 | + | |
2763 | 2787 | | |
2764 | 2788 | | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
2765 | 2793 | | |
2766 | 2794 | | |
2767 | 2795 | | |
2768 | | - | |
| 2796 | + | |
2769 | 2797 | | |
2770 | 2798 | | |
2771 | 2799 | | |
2772 | 2800 | | |
2773 | 2801 | | |
2774 | 2802 | | |
2775 | | - | |
2776 | | - | |
| 2803 | + | |
2777 | 2804 | | |
2778 | | - | |
| 2805 | + | |
2779 | 2806 | | |
2780 | 2807 | | |
2781 | 2808 | | |
2782 | 2809 | | |
2783 | 2810 | | |
2784 | 2811 | | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
2785 | 2821 | | |
2786 | | - | |
2787 | | - | |
2788 | | - | |
2789 | | - | |
2790 | | - | |
2791 | | - | |
2792 | | - | |
2793 | | - | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
2794 | 2863 | | |
2795 | 2864 | | |
2796 | 2865 | | |
| |||
2801 | 2870 | | |
2802 | 2871 | | |
2803 | 2872 | | |
2804 | | - | |
| 2873 | + | |
2805 | 2874 | | |
2806 | 2875 | | |
2807 | 2876 | | |
| |||
2970 | 3039 | | |
2971 | 3040 | | |
2972 | 3041 | | |
2973 | | - | |
2974 | | - | |
| 3042 | + | |
| 3043 | + | |
2975 | 3044 | | |
2976 | 3045 | | |
2977 | 3046 | | |
| |||
3199 | 3268 | | |
3200 | 3269 | | |
3201 | 3270 | | |
| 3271 | + | |
| 3272 | + | |
3202 | 3273 | | |
3203 | 3274 | | |
3204 | 3275 | | |
| |||
0 commit comments