oramasearch / orama

🌌 A complete search engine and RAG pipeline in your browser, server or edge network with support for full-text, vector, and hybrid search in less than 2kb.
https://docs.orama.com
Other
8.6k stars 289 forks source link

Explosion in Bundle Size #812

Closed jsudelko closed 1 week ago

jsudelko commented 1 week ago

Describe the bug

There's a 16x increase in size in your new 3.0.0-rc2 release. I'm not convinced that you need to have a browser, deno and ESM version. Where every single file is duplicated across all three.

I was trying to demo this in a browser REPL like I always have and it took much, much longer than usual.

If I was a new user browsing Orama to figure out if I should use it and saw it was 66.4KB on BundlePhobia, I'd not even bother downloading it in favor of the several seemingly (60-94%) smaller packages listed below. Bad for me, bad for you...because Orama is actually great!

To Reproduce

RC1 is 4.5KB Minified , 1.2KB Gzipped https://bundlephobia.com/package/@orama/orama@3.0.0-rc-1

RC2 is 66.4KB Minified, 20.8KB https://bundlephobia.com/package/@orama/orama@3.0.0-rc-2

Expected behavior

Small package please. Small package.

Environment Info

N/A

Affected areas

Initialization

Additional context

No response

micheleriva commented 1 week ago

Hi @jsudelko, thanks for bringing this up!

66.4kb is the total size of ALL the bundles exported by Orama (browser, commonjs, esm, etc). And it includes sourcemaps, type definitions, and compiled code for all the various JS runtimes. Once you import Orama into your project, even if you import ALL the functions you're still around 1.9kb.

If you're concerned about the install size (so on your local machine)... yes, that's slightly bigger.