askorama / orama

🌌 Fast, dependency-free, full-text and vector search engine with typo tolerance, filters, facets, stemming, and more. Works with any JavaScript runtime, browser, server, service!
https://docs.askorama.ai
Other
8.27k stars 273 forks source link

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

Closed ilteoood closed 2 months ago

ilteoood commented 2 months ago

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

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

vercel[bot] commented 2 months ago

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 commented 2 months ago

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

Will review this ASAP

ilteoood commented 2 months ago

@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 commented 2 months ago

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

micheleriva commented 2 months ago

This is awesome