logoalt Hacker News

tyingqtoday at 2:57 PM3 repliesview on HN

His also omits CRC, which is part of the 25k lines, no --fast/--best/etc, missing some output formats, and so on. I'm sure the 25k includes a lot of bloat, but the comparison is odd. Comparing to your list would make much more sense.


Replies

kibwentoday at 3:08 PM

I would expect a CRC to add a negligible number of lines of code. The reason that production-grade decompressors are tens of thousands of LOC is likely attributable to extreme manual optimization. For example, I wouldn't be surprised if a measurable fraction of those lines are actually inline assembly.

show 3 replies
fullstoptoday at 3:17 PM

gzip also contains a significant amount of compatibility code for different platforms.

xxstoday at 3:51 PM

Crc32 can be written in handful lines of code. Although it'd be better to use the vector instruction set - e.g. AVX when available.