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

reduce package size by compressing wasm base64 first via brotli? #2870

Closed
Uzlopak opened this issue Feb 28, 2024 · 9 comments
Closed

reduce package size by compressing wasm base64 first via brotli? #2870

Uzlopak opened this issue Feb 28, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Feb 28, 2024

I think we could save some bytes by compressing the base64 encoded wasm before the base64 encoding via brotli.

@Uzlopak Uzlopak added the enhancement New feature or request label Feb 28, 2024
@ronag
Copy link
Member

ronag commented Feb 28, 2024

Do you have any numbers? Just run it through brotli.

@mcollina
Copy link
Member

compression would trade startup time with disk space, and that's usually a bad trade.

@metcoder95
Copy link
Member

What problem are we trying to solve exactly?

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 28, 2024

If my assessment is right, than llhttp simd wasm shrinks from 55kb to 14kb. Thus base64 encoded wasm changes from 74kb to about 18kb. If #2871 removes normal wasm, than we speak of about a sofe of about 50 kb, if the PR does not pass and we still ship both wasm files, we speak a save of 100 kb.

@Uzlopak Uzlopak closed this as completed Feb 29, 2024
@ronag
Copy link
Member

ronag commented Feb 29, 2024

Doesn't npm compress the package anyway?

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 29, 2024

We pack undici into node. So node gets bigger.

@ronag
Copy link
Member

ronag commented Feb 29, 2024

We pack undici into node. So node gets bigger.

Isn't node also compressed?

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 29, 2024

idk. but even if compression doesnt mean a reduction to 0. ;)

@ronag
Copy link
Member

ronag commented Feb 29, 2024

I mean you get pretty much the same compression if you compress it before the bundle or compress it with the bundle...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants