H. Walczak

Projects, experiments & other distractions.

bzip2-codec

JAVASCRIPT / COMPRESSION LAB

Less in. More out.

Watch bzip2 decompression in motion. Real bytes, real throughput, and a live view inside the output. No server-side decoding. No whole-file buffer.

↗
example.dem.bz2Bundled CS2 demo · streamed over HTTP
Ready when you are0.0s elapsed
01 / FETCH0.0 MiBcompressed bytes received
→
02 / BZIP2-CODEC0.0 MiBdecoded bytes emitted
→
03 / STREAM SINK0output chunks processed & released
Waiting for input size
Decoded throughput0.0 MiB/s
Average output rate0.0 MiB/s
Expansion so far0.00×
Input chunks0

Throughput, as it happens

1-second window · 0 samples retained
Decoded outputCompressed input1.0 MiB/s scale
0.0s elapsedStart a run to collect real samples
Current memory · latest sampleMeasuring…
Peak sampled · since page opened-
Worker concurrency · browser reportedChecking…

Waiting for the browser to measure memory. It may wait for garbage collection.

Inside the output

sampled byte distribution
0x000xFF

Up to 256 sampled bytes per output chunk. Values accumulate during the run.

Fresh from the decoder

latest chunk · first 64 bytes
································································································································

A tiny window into the stream. The full decoded file is never retained.

THE PIPELINE

Small chunks.
Continuous work.

fetch → bzip2 → WritableStream

The worker reads a compressed stream, decodes it in blocks, and passes output forward with backpressure. The interface receives small telemetry snapshots about eight times a second. Stop terminates the worker and its work.

Charts show this run, not a benchmark against another library. Throughput includes fetching and decompression; device speed and network conditions matter. Output is limited to 2 GiB per run.