-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search-index.js slows down documentation browsing #56545
Comments
Funny enough: chrome is very slow to render Rust documentation (give a try to firefox if you want it to be faster). However, some PRs should greatly improve this situation (like #56005). Before then, we can't help you much on this... |
No worries, I'm happy to wait. Let's see how much better will it get once the improvements are in. I'll leave this one open for the time being so other people who wonder about this have a reference point. Thanks! |
This is a pretty serious issue for me. I've been trying to browse the documentation for the atsamd-rs crate and the |
I had the same issue when opening the page... Any idea to reduce the size of this file is very welcome. I opened #71144 recently but not sure we'll go forward with it considering it'd reduce the search usefulness. An idea I had was to rely on wasm. I need to investigate it too. |
It might help to convert |
I think it's worth a try. I'll test it tomorrow. |
…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/rustdoc
…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/rustdoc
…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/rustdoc
…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/rustdoc
@GuillaumeGomez Sounds like this can be closed with the switch to JSON? |
Absolutely! |
I'm just starting with Rust, so I'm using its documentation quite often. Primarily along the lines of "hmm, no idea if a thing like foo exists in stdlib... let's search the docs.". This means, I'm changing pages of documentation a lot. I've noticed that when I'm jumping to a specific method's docs, I get the following experience:
I've looked at Chrome's console, and I've noticed that
search-index.js
is the culprit.Note that the above is loading from a
file://
URI, after launchingrustup doc
. That index is 2MB, and it looks like it contains all keywords for the search. Not sure why it's equally slow on both online and local docs.Any chance of improvement here, to speed up the initial load? Loading the index asynchronously, to have it ready for user search once user decides to use it?
The text was updated successfully, but these errors were encountered: