tools/android: Benchmark brotli compression on JS.

Adds support for brotli compression to the compression_benchmark test
tool. Results below are taken from a sample of JS files found on the web (see
the linked bug).

Overall, at comparable compression ratios, brotli is slower than zlib for
decompression but faster at compression, on Android and Linux. Tested on
Pixel (Android) and Xeon "broadwell" (linux).

For instance, for a 32kiB chunk size:
- Linux
Zlib
Size = 32768
Compression
  Compression ratio = 2.97379
  Throughput = 35.7633MB/s
  Latency (size = 32768) = 916.246us
Decompression
  Throughput = 329.092MB/s
  Latency (size = 32768) = 99.5711us

Brotli
Size = 32768
Compression
  Compression ratio = 2.81762
  Throughput = 52.4092MB/s
  Latency (size = 32768) = 625.234us
Decompression
  Throughput = 159.92MB/s
  Latency (size = 32768) = 204.903us

- Android
Zlib
Size = 32768
Compression
  Compression ratio = 2.97379
  Throughput = 18.7666MB/s
  Latency (size = 32768) = 1746.08us
Decompression
  Throughput = 204.837MB/s
  Latency (size = 32768) = 159.971us

Brotli
Size = 32768
Compression
  Compression ratio = 2.81762
  Throughput = 30.1437MB/s
  Latency (size = 32768) = 1087.06us
Decompression
  Throughput = 85.4071MB/s
  Latency (size = 32768) = 383.668us

Bug: 907489
Change-Id: Ia6b0877fa6964098bd99e8d2dea3ff09e316d910
Reviewed-on: https://chromium-review.googlesource.com/c/1356549
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#612903}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c1120e9b2177c679288a3bdccecaba357f8c3bf8
3 files changed