←back to thread

Sqlite3 WebAssembly

(sqlite.org)
506 points whatever3 | 5 comments | | HN request time: 0s | source
Show context
TiredGuy ◴[] No.41851263[source]
So after downloading from the official downloads page and stripping away all the mjs files and "bundler-friendly" files, a minimal sqlite wasm dependency will be about 1.3MB.

For an in-browser app, that seems a bit much but of course wasm runs in other places these days where it might make more sense.

replies(8): >>41851337 #>>41851618 #>>41851622 #>>41851724 #>>41851840 #>>41852258 #>>41854092 #>>41855860 #
jsheard ◴[] No.41851622[source]
It's pretty compressible at least, sqlite3.js+wasm are 1.3MB raw but minifying the JS and then compressing both files with Brotli gets them down to 410KB.
replies(1): >>41852828 #
1. rmbyrro ◴[] No.41852828[source]
A lot of HTML's nowadays have 100 - 300 kb. That's only the HTML (!!).

Adding 400 for such a high quality piece of DB actually borders reasonability.

And makes me think: what the hell are frontend devs thinking!? Multiple MB's in JS for a news website. Hundreds of KB's for HTML. It's totally unreasonable.

replies(2): >>41853979 #>>41854129 #
2. wahern ◴[] No.41853979[source]
> what the hell are frontend devs thinking!? Multiple MB's in JS for a news website. Hundreds of KB's for HTML. It's totally unreasonable

They're thinking, "adding [some fraction of existing total payload] for such a high quality [feature] actually borders reasonability". Wash. Rinse. Repeat.

replies(1): >>41856528 #
3. jsheard ◴[] No.41854129[source]
> A lot of HTML's nowadays have 100 - 300 kb. That's only the HTML (!!).

I think you can probably blame Tailwind for that.

replies(1): >>41856625 #
4. Dylan16807 ◴[] No.41856528[source]
> They're thinking, "adding [some fraction of existing total payload] for such a high quality [feature] actually borders reasonability". Wash. Rinse. Repeat.

Context makes all the difference here. If you're considering a big chunk of size for a relational database engine, you need to ask: are you making a complex application, or a normal web page? If it's the latter, then it's not reasonable at all.

And anything that makes the HTML itself that big is almost certainly bloat, not "high quality", and shouldn't be used in any context.

5. yoavm ◴[] No.41856625[source]
Why? More often than not the classes are combined during post-processing to the most reusable unified classes, with very short classes names.