-
-
Notifications
You must be signed in to change notification settings - Fork 76
Open
@navarroaxel
Description
Actual behavior
Updating this client’s cache takes ~41 seconds.
Loading the pages' cache takes < 1 second.
The cache for the --search argument takes the rest of the time.
Explaining the build index process
The process reads every page and builds a dictionary {key: count} with key as the word and count indicating how many times that word appears on the given page.
Options to improve this process
- Create the dictionary when
--searchis executed and thesearch-corpus.jsonfile isn't created. Then clean the file when the index is updated. - Split the process into threads (child process, threads or whatever) using chunks or one thread per platform.
- Use a background process to create the
search-corpus.json. - Use the solution proposed in Feature Request: Wait 30 minutes to update cache again #350 (don't update the dictionary on every miss).
Environment
- Operating system - Arch Linux
- Node.js version any (tested in v12 and v16)