diff --git a/README.md b/README.md
index 6ec664e..761d0ff 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,11 @@ func main() {
}
```
+## Benchmark
+
+See the [benchmark results](results.md) to get an idea of the relative performance and
+compression efficiency of gzip, brotli and zstd in the current implementation.
+
## TODO
- Add dictionary support to gzip and brotli (zstd already supports it)
diff --git a/results.md b/results.md
new file mode 100644
index 0000000..efec371
--- /dev/null
+++ b/results.md
@@ -0,0 +1,176 @@
+Results of running
+```
+go test -count=5 -bench=././././serial | benchstat -html > results.md
+```
+
+The benchmark names follow the format `Adapter/(body_size)/(encoder)/(level)/serial-*`.
+
+The first table lists time to compress the body with the specified encoder and level.
+
+The second table lists the size of the resulting compressed body.
+
+
+
+name | time/op |
+
---|
Adapter/10/gzip/1/serial-12 | 924ns ± 0% |
+
Adapter/10/br/1/serial-12 | 933ns ± 5% |
+
Adapter/10/zstd/1/serial-12 | 968ns ± 5% |
+
Adapter/100/gzip/1/serial-12 | 960ns ± 6% |
+
Adapter/100/br/1/serial-12 | 963ns ± 6% |
+
Adapter/100/zstd/1/serial-12 | 975ns ± 6% |
+
Adapter/1000/gzip/1/serial-12 | 30.8µs ±10% |
+
Adapter/1000/gzip/2/serial-12 | 85.9µs ± 5% |
+
Adapter/1000/gzip/3/serial-12 | 85.6µs ± 0% |
+
Adapter/1000/gzip/4/serial-12 | 89.2µs ± 5% |
+
Adapter/1000/gzip/5/serial-12 | 89.3µs ± 0% |
+
Adapter/1000/gzip/6/serial-12 | 91.4µs ± 2% |
+
Adapter/1000/gzip/7/serial-12 | 93.1µs ± 6% |
+
Adapter/1000/gzip/8/serial-12 | 93.4µs ± 6% |
+
Adapter/1000/gzip/9/serial-12 | 93.5µs ± 8% |
+
Adapter/1000/br/1/serial-12 | 27.7µs ± 1% |
+
Adapter/1000/br/2/serial-12 | 42.6µs ±10% |
+
Adapter/1000/br/3/serial-12 | 69.9µs ± 4% |
+
Adapter/1000/br/4/serial-12 | 99.4µs ±12% |
+
Adapter/1000/br/5/serial-12 | 111µs ± 7% |
+
Adapter/1000/br/6/serial-12 | 112µs ± 4% |
+
Adapter/1000/br/7/serial-12 | 141µs ± 4% |
+
Adapter/1000/br/8/serial-12 | 147µs ±19% |
+
Adapter/1000/br/9/serial-12 | 154µs ± 1% |
+
Adapter/1000/br/10/serial-12 | 2.44ms ± 5% |
+
Adapter/1000/br/11/serial-12 | 4.09ms ± 1% |
+
Adapter/1000/zstd/1/serial-12 | 18.1µs ±10% |
+
Adapter/1000/zstd/2/serial-12 | 21.6µs ± 7% |
+
Adapter/1000/zstd/3/serial-12 | 31.2µs ±14% |
+
Adapter/1000/zstd/4/serial-12 | 79.9µs ±14% |
+
Adapter/10000/gzip/1/serial-12 | 134µs ±19% |
+
Adapter/10000/gzip/2/serial-12 | 201µs ± 3% |
+
Adapter/10000/gzip/3/serial-12 | 203µs ± 1% |
+
Adapter/10000/gzip/4/serial-12 | 247µs ±19% |
+
Adapter/10000/gzip/5/serial-12 | 246µs ± 1% |
+
Adapter/10000/gzip/6/serial-12 | 269µs ± 7% |
+
Adapter/10000/gzip/7/serial-12 | 335µs ± 3% |
+
Adapter/10000/gzip/8/serial-12 | 371µs ± 0% |
+
Adapter/10000/gzip/9/serial-12 | 381µs ±11% |
+
Adapter/10000/br/1/serial-12 | 148µs ± 2% |
+
Adapter/10000/br/2/serial-12 | 325µs ±10% |
+
Adapter/10000/br/3/serial-12 | 389µs ± 0% |
+
Adapter/10000/br/4/serial-12 | 557µs ±19% |
+
Adapter/10000/br/5/serial-12 | 614µs ± 2% |
+
Adapter/10000/br/6/serial-12 | 655µs ± 8% |
+
Adapter/10000/br/7/serial-12 | 804µs ± 4% |
+
Adapter/10000/br/8/serial-12 | 823µs ± 7% |
+
Adapter/10000/br/9/serial-12 | 978µs ± 5% |
+
Adapter/10000/br/10/serial-12 | 10.9ms ± 8% |
+
Adapter/10000/br/11/serial-12 | 29.5ms ±14% |
+
Adapter/10000/zstd/1/serial-12 | 74.6µs ±16% |
+
Adapter/10000/zstd/2/serial-12 | 124µs ± 8% |
+
Adapter/10000/zstd/3/serial-12 | 200µs ± 7% |
+
Adapter/10000/zstd/4/serial-12 | 634µs ± 8% |
+
Adapter/100000/gzip/1/serial-12 | 1.12ms ± 9% |
+
Adapter/100000/gzip/2/serial-12 | 1.35ms ± 1% |
+
Adapter/100000/gzip/3/serial-12 | 1.53ms ± 5% |
+
Adapter/100000/gzip/4/serial-12 | 1.73ms ± 6% |
+
Adapter/100000/gzip/5/serial-12 | 1.99ms ± 1% |
+
Adapter/100000/gzip/6/serial-12 | 2.34ms ± 7% |
+
Adapter/100000/gzip/7/serial-12 | 3.80ms ±12% |
+
Adapter/100000/gzip/8/serial-12 | 8.67ms ± 3% |
+
Adapter/100000/gzip/9/serial-12 | 8.96ms ±12% |
+
Adapter/100000/br/1/serial-12 | 1.48ms ±13% |
+
Adapter/100000/br/2/serial-12 | 3.01ms ± 5% |
+
Adapter/100000/br/3/serial-12 | 3.51ms ± 2% |
+
Adapter/100000/br/4/serial-12 | 4.58ms ± 7% |
+
Adapter/100000/br/5/serial-12 | 5.51ms ± 0% |
+
Adapter/100000/br/6/serial-12 | 6.04ms ± 4% |
+
Adapter/100000/br/7/serial-12 | 7.11ms ± 0% |
+
Adapter/100000/br/8/serial-12 | 7.86ms ± 3% |
+
Adapter/100000/br/9/serial-12 | 10.2ms ± 5% |
+
Adapter/100000/br/10/serial-12 | 113ms ±10% |
+
Adapter/100000/br/11/serial-12 | 312ms ± 2% |
+
Adapter/100000/zstd/1/serial-12 | 629µs ± 1% |
+
Adapter/100000/zstd/2/serial-12 | 859µs ± 4% |
+
Adapter/100000/zstd/3/serial-12 | 1.02ms ± 2% |
+
Adapter/100000/zstd/4/serial-12 | 3.79ms ±11% |
+
+
+
+
+name | % |
+
---|
Adapter/10/gzip/1/serial-12 | 100 ± 0% |
+
Adapter/10/br/1/serial-12 | 100 ± 0% |
+
Adapter/10/zstd/1/serial-12 | 100 ± 0% |
+
Adapter/100/gzip/1/serial-12 | 100 ± 0% |
+
Adapter/100/br/1/serial-12 | 100 ± 0% |
+
Adapter/100/zstd/1/serial-12 | 100 ± 0% |
+
Adapter/1000/gzip/1/serial-12 | 44.2 ± 0% |
+
Adapter/1000/gzip/2/serial-12 | 41.9 ± 0% |
+
Adapter/1000/gzip/3/serial-12 | 41.7 ± 0% |
+
Adapter/1000/gzip/4/serial-12 | 41.7 ± 0% |
+
Adapter/1000/gzip/5/serial-12 | 41.1 ± 0% |
+
Adapter/1000/gzip/6/serial-12 | 41.1 ± 0% |
+
Adapter/1000/gzip/7/serial-12 | 41.0 ± 0% |
+
Adapter/1000/gzip/8/serial-12 | 41.0 ± 0% |
+
Adapter/1000/gzip/9/serial-12 | 41.0 ± 0% |
+
Adapter/1000/br/1/serial-12 | 45.2 ± 0% |
+
Adapter/1000/br/2/serial-12 | 42.1 ± 0% |
+
Adapter/1000/br/3/serial-12 | 39.9 ± 0% |
+
Adapter/1000/br/4/serial-12 | 39.3 ± 0% |
+
Adapter/1000/br/5/serial-12 | 36.6 ± 0% |
+
Adapter/1000/br/6/serial-12 | 36.8 ± 0% |
+
Adapter/1000/br/7/serial-12 | 36.7 ± 0% |
+
Adapter/1000/br/8/serial-12 | 36.7 ± 0% |
+
Adapter/1000/br/9/serial-12 | 36.7 ± 0% |
+
Adapter/1000/br/10/serial-12 | 37.4 ± 0% |
+
Adapter/1000/br/11/serial-12 | 37.2 ± 0% |
+
Adapter/1000/zstd/1/serial-12 | 43.1 ± 0% |
+
Adapter/1000/zstd/2/serial-12 | 42.2 ± 0% |
+
Adapter/1000/zstd/3/serial-12 | 41.7 ± 0% |
+
Adapter/1000/zstd/4/serial-12 | 41.3 ± 0% |
+
Adapter/10000/gzip/1/serial-12 | 29.6 ± 0% |
+
Adapter/10000/gzip/2/serial-12 | 28.5 ± 0% |
+
Adapter/10000/gzip/3/serial-12 | 28.1 ± 0% |
+
Adapter/10000/gzip/4/serial-12 | 28.2 ± 0% |
+
Adapter/10000/gzip/5/serial-12 | 27.7 ± 0% |
+
Adapter/10000/gzip/6/serial-12 | 27.6 ± 0% |
+
Adapter/10000/gzip/7/serial-12 | 27.2 ± 0% |
+
Adapter/10000/gzip/8/serial-12 | 27.2 ± 0% |
+
Adapter/10000/gzip/9/serial-12 | 27.2 ± 0% |
+
Adapter/10000/br/1/serial-12 | 29.9 ± 0% |
+
Adapter/10000/br/2/serial-12 | 28.1 ± 0% |
+
Adapter/10000/br/3/serial-12 | 27.9 ± 0% |
+
Adapter/10000/br/4/serial-12 | 27.5 ± 0% |
+
Adapter/10000/br/5/serial-12 | 26.0 ± 0% |
+
Adapter/10000/br/6/serial-12 | 25.9 ± 0% |
+
Adapter/10000/br/7/serial-12 | 25.8 ± 0% |
+
Adapter/10000/br/8/serial-12 | 25.8 ± 0% |
+
Adapter/10000/br/9/serial-12 | 25.8 ± 0% |
+
Adapter/10000/br/10/serial-12 | 23.4 ± 0% |
+
Adapter/10000/br/11/serial-12 | 23.1 ± 0% |
+
Adapter/10000/zstd/1/serial-12 | 28.6 ± 0% |
+
Adapter/10000/zstd/2/serial-12 | 28.1 ± 0% |
+
Adapter/10000/zstd/3/serial-12 | 28.0 ± 0% |
+
Adapter/10000/zstd/4/serial-12 | 27.6 ± 0% |
+
Adapter/100000/gzip/1/serial-12 | 27.3 ± 0% |
+
Adapter/100000/gzip/2/serial-12 | 26.2 ± 0% |
+
Adapter/100000/gzip/3/serial-12 | 25.7 ± 0% |
+
Adapter/100000/gzip/4/serial-12 | 25.8 ± 0% |
+
Adapter/100000/gzip/5/serial-12 | 25.0 ± 0% |
+
Adapter/100000/gzip/6/serial-12 | 24.8 ± 0% |
+
Adapter/100000/gzip/7/serial-12 | 24.2 ± 0% |
+
Adapter/100000/gzip/8/serial-12 | 24.1 ± 0% |
+
Adapter/100000/gzip/9/serial-12 | 24.1 ± 0% |
+
Adapter/100000/br/1/serial-12 | 27.6 ± 0% |
+
Adapter/100000/br/2/serial-12 | 25.4 ± 0% |
+
Adapter/100000/br/3/serial-12 | 25.3 ± 0% |
+
Adapter/100000/br/4/serial-12 | 24.9 ± 0% |
+
Adapter/100000/br/5/serial-12 | 23.6 ± 0% |
+
Adapter/100000/br/6/serial-12 | 23.4 ± 0% |
+
Adapter/100000/br/7/serial-12 | 23.3 ± 0% |
+
Adapter/100000/br/8/serial-12 | 23.2 ± 0% |
+
Adapter/100000/br/9/serial-12 | 23.2 ± 0% |
+
Adapter/100000/br/10/serial-12 | 20.2 ± 0% |
+
Adapter/100000/br/11/serial-12 | 19.9 ± 0% |
+
Adapter/100000/zstd/1/serial-12 | 25.9 ± 0% |
+
Adapter/100000/zstd/2/serial-12 | 25.7 ± 0% |
+
Adapter/100000/zstd/3/serial-12 | 25.6 ± 0% |
+
Adapter/100000/zstd/4/serial-12 | 25.3 ± 0% |
+