-
Notifications
You must be signed in to change notification settings - Fork 4
Search UI perfomance issues #23
Comments
What search are you referring to? Can you provide a link to an exemplar URL? The site that this repo is for has no search. I suspect you mean https://stdlib.ponylang.io/. If that is the case, the repo for that would be https://github.com/ponylang/mkdocs-theme. |
You are right, I was talking about search on https://stdlib.ponylang.io/ . Thanks for re-direction. I will open issue there. |
@gtb no need to open an issue there! I can transfer this one. |
|
On FF, this is super slow for me for the first search then pokey after that. On MS Edge Dev, it is slow for first search and snappy after that. |
MS Edge Dev: 1 sec delay on first search, then snappy. |
The reason for the slowdown is that the search index to operate on is fetched when the search field is accessed the first time. The code responsible for this is here: mkdocs-theme/src/assets/javascripts/components/Material/Search/Result.jsx Lines 132 to 224 in d17f178
It currently fetches the 3.6MB index in json format, parses it and builds the index from it. Those operations are responsible for the delay. I am not sure we can do much about the general operations necessary for building up the index. One thing we should look at is to exclude the sources from the search index which should make it significantly smaller and will thus speed up things. And we should make it properly visible that the search is initializing, maybe some spinner or whatever UX element is best for that purpose. |
Material for MkDocs 5.0.0 has been released. Among other things, it includes:
The first two items would probably be enough to solve this issue. If not, we could look into the last one. This would probably need a squash-and-commit from the changes on upstream after 76d72da until abd2fc3, which would probably break a few things here. It would also break the current docgen -- since there were some breaking changes from version 2.7.1 of this fork up to upstream's 5.0.0 --, so ponyc will require some minor adjustments as well. |
@EpicEric do you know what would need to change with ponyc's docgen? |
A small thing we could also do in the meantime is not index the |
This isnt actually a thing mkdocs supports. :( |
@SeanTAllen said:
No, I don't recall what I meant by that. |
@EpicEric does it only index directories that are in mkdocs.yml? |
I prebuilt the index for https://ponylang.github.io/appdirs/ and it didn't seem to make a difference. Is there something extra that needs to be done as far as you know @EpicEric ? |
Hello.
I'm experiencing huge slowdown during first opening of search dropdown after a documentation page (re)load. I click inside search text edit, dropdown starts to open and then it hangs for about 4 to 8 seconds not reacting to keystrokes. After it unfreezes, buffered keystrokes gets displayed, but still its quite annoying, since as a newcomer I tend to open many tabs with docs and travel between them a lot.
I've suspected a slow network query, so I've looked into developer tools and looks like its not a query but some slow promise.
I'm using Firefox 69.0.1 (64-bit) with Arch Linux on an old but decent notebook with intel i5 and 8gb of ram.
The text was updated successfully, but these errors were encountered: