Skip to content

Improve update cache process #353

@navarroaxel

Description

@navarroaxel

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

  1. Create the dictionary when --search is executed and the search-corpus.json file isn't created. Then clean the file when the index is updated.
  2. Split the process into threads (child process, threads or whatever) using chunks or one thread per platform.
  3. Use a background process to create the search-corpus.json.
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions