Commit 2f06ac0
authored
Rollup merge of rust-lang#71250 - GuillaumeGomez:use-json-instead-of-js, r=kinnison
Replace big JS dict with JSON parsing
Part of rust-lang#56545.
@ollie27 suggested that using JSON instead of a JS dict might be faster, so I decided to test it. And the results far exceeded whatever expectations I had...
I used https://github.com/adamgreig/stm32ral for my tests. If you want to build it locally:
```bash
$ cargo doc --features doc --open
```
But I strongly recommend to do it with this PR. Some numbers:
* Loading a page with the JSON search-index: less than 1 second
* Loading a page with the JS search-index: crashed after 30 seconds
I think the results are clear enough...
r? @ollie27
cc @rust-lang/rustdoc2 files changed
+41
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
792 | 823 | | |
793 | 824 | | |
794 | 825 | | |
| |||
909 | 940 | | |
910 | 941 | | |
911 | 942 | | |
912 | | - | |
| 943 | + | |
913 | 944 | | |
914 | 945 | | |
915 | 946 | | |
916 | 947 | | |
917 | 948 | | |
918 | 949 | | |
919 | | - | |
920 | | - | |
| 950 | + | |
| 951 | + | |
921 | 952 | | |
922 | 953 | | |
923 | | - | |
| 954 | + | |
924 | 955 | | |
925 | 956 | | |
926 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
645 | 650 | | |
646 | 651 | | |
647 | 652 | | |
| |||
0 commit comments