Skip to content
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

Lunr search performance #127

Open
jcuenod opened this issue Apr 9, 2020 · 0 comments
Open

Lunr search performance #127

jcuenod opened this issue Apr 9, 2020 · 0 comments

Comments

@jcuenod
Copy link

jcuenod commented Apr 9, 2020

I am experiencing significant performance issues with lunr.js.

I have about 250 posts of 500-1000 words which means my searchengine file is about 500kb. The real killer though is execution (consistently greater than 5s).

I thought defer would be an adequate fix but it doesn't seem to be (I'm still trying to figure out why but lunr is definitely still delaying rendering).

There are a number of possible solutions here:

  1. The most interesting one is an idea I had to use something like Cloudflare workers
  2. Perhaps more realistic for the theme is to figure out how to adequately defer the script's execution or somehow break it into smaller async pieces.

[EDIT:] It looks to me as though I'm having the same problem as this: mkdocs/mkdocs#859

This suggests that prebuilding the index (and compressing) and using a webworker in the middle (presumably for caching) would alleviate a lot of this pain... (cf. mkdocs/mkdocs#1418)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant