Hacker News new | ask | show | jobs
by tnelsond4 9 days ago
I was using the original zstd rust crate for my web app, but I couldn't get my module any smaller than 150kb, but when I switched to C for web app I was able to do a whole lot of optimizing and culling until I got it down to 39kb.

I wanted to like Rust, but I was using unsafe code for performance and such anyway that it made more sense to switch to C.

1 comments

> I got it down to 39kb.

If you're counting KBs and you have to include zstd yourself (a reverse proxy isn't handling it for you) does that mean you're targeting an embedded device? Are you supporting TLS at that size?

39kb includes the zstd decoder which is statically compiled into it. I'm not targeting microcontrollers, but I am targeting smartphones in areas with bad internet connections, so every kilobyte saved is nice. I also just like to optimize things and make them minimal while still being powerful. I don't handle tls, GitHub pages handles all that, I'm just using it to host a static pwa.