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

Changed how index is loaded to improve performance #1826

Conversation

dragomirtitian
Copy link
Collaborator

This PR fixes #1825. Using JSON.parse ensures faster loading as the grammar for JSON is much simpler, so parsing JSON instead of JavaScript will be much faster (1s vs 7s in out use case)

We could consider JSON imports at a later date when that proposal reaches stage 4.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 3, 2022

JSON imports I believe will run into the same issue as using regular imports when browsing files locally (i.e. not in a web browser), so I think we'll probably want to avoid those unfortunately. LGTM once lint passes!

@dragomirtitian dragomirtitian force-pushed the feat-improve-index-loading-perf branch from 0112437 to 2767ae9 Compare January 11, 2022 14:24
@dragomirtitian dragomirtitian merged commit a67e40b into TypeStrong:master Jan 13, 2022
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

Successfully merging this pull request may close these issues.

Use JSON.parse to load searchData
2 participants