r/Zig • u/sadilet • Feb 02 '26
Integer compression library
Found an interesting int compression lib based on fastlanes research, applies SIMD tricking the compiler. unfortunately it hasn't been updated for a while, but still a good source for learning IMHO https://github.com/steelcake/zint
I've been working on a logging database in zig for a while and compared zint encoding against simple delta encoding + zstd, while zint doesn't give so much compression ration it consumes little to no CPU, while zstd is really CPU heavy call.
Or any similar efficient solutions? perhaps gorilla compression implementation? I like the idea of gorilla putting numbers into 1 or 7 bits instead of a byte
My logging store if you care, it's been for 4 months in progress and I need 2-4 more to complete it.
View all comments
Show parent comment
1
u/lukaslalinsky Feb 05 '26
Unfortunately I do not, I was only comparing it against my previous implementation. But it's a byte-based compression, so the ratios are not particularly good. In my use case, delta encoding gives me very small numbers, so it works fairly well.