logoalt Hacker News

weitendorf • today at 10:53 AM • 2 replies • view on HN

I'm gonna try this later. I just got a 5x (single core, 5MB/s) - 10x (dual core 10MB/s) speedup on brotli in the last few days. It's been really surprising to realize how much storage and traffic bandwidth is going to waste because of unoptimized transit.

brotli -11 is so slow nobody probably uses it right now but at 10x speed it actually becomes pretty ok. It's a more efficient encoding than zstd (and gzip by far) at their max compression settings.

Haven't got a writeup yet but: https://claude.ai/share/0e8bf6c0-6d64-4a34-8f97-37ccbae19732

Brotli/zstd are kind of in a class of their own in my view because of their direct browse integration and support. That's why I focused on brotli specifically. Didn't know so many others on hn were also working on this rn.

I actually just did it in x86_64 but if you start there it's trivial to wrap that in C/Go/etc these days. Here's the Go+C shim: https://claude.ai/share/57ddeb9a-36bf-4690-99d5-621147b15a77


Replies

vardump • today at 12:12 PM

Might have been better to ask Claude to emit C/C++ code with intrinsics (which is actually what Claude did at some point!).

Compilers are pretty good at optimally scheduling instructions for different CPU architectures, so using assembler directly is counterproductive.

➕ show 1 reply
fullstop • today at 12:26 PM

Compression is really cool, and while bandwidth goes to waste without it there are (historically) so many bugs around it. Maybe this will get better with AI hammering at it, but there's so many buffer overflow bugs, chained decompression bugs, DoS attacks, etc. It's surprisingly difficult to get right.

➕ show 1 reply