orama icon indicating copy to clipboard operation
orama copied to clipboard

Several optimizations

Open masylum opened this issue 1 year ago • 3 comments

I've been profiling orama, since it's taking 4s to ingest around 4k documents on my project and I would like to lower this down. I've noticed several things: It's ingesting a large amount of empty strings which is useless CPU time and also it's recalculating ids redundantly. This commit tries to address this two issues.

Additionally, I've noticed that due to the async APIs, the code is spending most of it's time waiting for "run microtasks". I have no idea if it would be possible to compile those away, because right now it makes the default implementation much worse (performance-wise) in order for people to be able to provide their storage solution.

Lastly, I've also noticed that providing the ID of the document, makes the ID be stored as part of the document properties. I thought it would only be to replace the default orama ID. I will fix this myself in userland by using getDocumentProperties, but perhaps is good to either change this default or document it.

masylum avatar Jun 17 '24 09:06 masylum

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

Name Status Preview Comments Updated (UTC)
orama-docs ❌ Failed (Inspect) Jun 17, 2024 9:58am

vercel[bot] avatar Jun 17 '24 09:06 vercel[bot]

Hi there! I fear you'll need to regenerate the test snapshots. The PR looks good then!

Thank you so much

micheleriva avatar Jun 28 '24 10:06 micheleriva

how do I do that?

masylum avatar Jul 24 '24 20:07 masylum