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

perf(orama): improve speed of heavy tasks #682

Merged
merged 15 commits into from
Apr 5, 2024
Merged

Conversation

ilteoood
Copy link
Contributor

@ilteoood ilteoood commented Apr 4, 2024

With this PR I would like to make some code changes in order to improve Orama's speed during heavy operations, like:

  • for loops
  • extraction of the same data
  • function called with a high number of parameters
  • new object creation only when needed
  • usage of optional chaining

Additionally, since I don't know the details of Orama's codebase, I have inserted a couple of comments for future improvements that I can do in this PR or in another one.

Note for the reviewers: the only changes I made are in the orama package. Everything else is related to formatting fixes made by the biome upgrade

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orama-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2024 6:16am

@micheleriva
Copy link
Member

Wow! Thank you Matteo! Please make sure to format the code correctly by running pnpm format before committing 🙏

Will review this ASAP

@ilteoood
Copy link
Contributor Author

ilteoood commented Apr 5, 2024

@micheleriva version 1.4.1 of biome was not working on GitHub codespaces. I upgraded it to the latest one (1.6.4) and executed the format script but...the number of changed files slightly increased 🥲

@allevo
Copy link
Collaborator

allevo commented Apr 5, 2024

I see a performance improvement of 5% in some cases during the search.
I run the scripts here.

@micheleriva
Copy link
Member

This is awesome

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.

None yet

3 participants