olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.87k stars 547 forks source link

lunr taking +4 seconds CPU time #465

Closed improvethings closed 3 years ago

improvethings commented 4 years ago

I'm using lunr.js with the minimal-mistakes jeyll theme. When I try the URL in Chrome, and then go to Audit/Lighthouse, it consistently shows lunr as taking +4-9 seconds total CPU time.

lunrjs

$ ls -l _posts/ | wc -l 366

Any suggestions on how to get this under 1 second?

olivernn commented 4 years ago

It is probably better to open this issue on the minimal-mistakes theme project, I'm not familiar with how they use Lunr.

I'm guessing that the search index is being built on the client side on each page load. To improve performance then index can be built server side.