What are you doing this week?

Lobsters Hottest News

Summary

A developer shares progress on value block compression for an index using zigzag delta encoding and LZ4, aiming to save about 4 TB of disk space by enhancing compression efficiency.

<p>What are you doing this week? Feel free to share!</p> <p>Keep in mind it’s OK to do nothing at all, too.</p>
Original Article
View Cached Full Text

Cached at: 09/21/26, 02:25 PM

# What are you doing this week? Source: [https://lobste.rs/s/fyngrv/what_are_you_doing_this_week](https://lobste.rs/s/fyngrv/what_are_you_doing_this_week) Fiddling with value block compression in the marginalia index\. Very cursed stuff\. A bit simplified, but I'm basically zigzag delta encoding\[1\] the data and then reshuffling it in byte planes, and then compressing them with LZ4\. So if I have for the sake of simplicity 64 longs that have been zigzag delta encoded, the data is rearranged into ``` (all the 1st bytes of the coded longs), (all the 2nd bytes of the coded longs), (all the 3rd bytes of the coded longs), (all the 4th bytes of the coded longs), (all the 5th bytes of the coded longs), (all the 6th bytes of the coded longs), (all the 7th bytes of the coded longs), (all the 8th bytes of the coded longs) ``` The result of the zigzag delta treatment is that a lot of the most significant byte planes end up being very predictable, often long runs of zeroes\. It's like the worst imaginable L1 cache access pattern since you need to read 8 different cache lines to assemble one value, but it nearly doubles the compression rate\[2\], which makes for fewer disk reads, and L1 cache misses are a drop in the ocean compared to an I/O roundtrip\. Real benefit is that it significantly slashes the disk requirements of the index, which is very chonky right now, and in the ballpark of half of the index is this data\. Will probably save about 4 TB of disk space altogether when this goes live\. \[1\] Encode the difference between values, and then make every other value represent negative values, to avoid the bit flipping in two's complement\. \[2\] I'm getting about 70% compression which is very good for standard\-mode LZ4\.

Similar Articles

OpenZL

Lobsters Hottest

OpenZL is a compression library that generates specialized compressors for specific data formats, achieving high compression ratios at high speeds suitable for datacenter workloads like AI processing.

Accelerating the Zig Tokenizer (with AVX-512)

Lobsters Hottest

Niles Salter’s talk introduces how to use SIMD data parallelism and bit manipulation primitives (CTZ, TZCNT, etc.) to accelerate a Zig tokenizer, achieving a throughput of 820 MB/s, and explores the potential for further speedups with AVX-512.

What are you doing this weekend?

Lobsters Hottest

A developer shares progress on porting marginalia search's inverted index from Java to C++, noting improved expressiveness, possible halving of line count, and the usefulness of std::span for contiguous memory handling.