tools/android: Improve compression_benchmark.

Instead of compressing only the start of the data to report smaller chunks
compression ratios, compress all the data chunk by chunk.

This is meant to accurately represent the impact of larger block sizes on
compression ratios, highlighting the impact of compressing whole scripts rather
than individual pages.

On Pixel (1st generation):

Gzip
 Size = 4096
 Compression
  Compression ratio = 2.2817
  Throughput = 21.2864MB/s
  Latency (size = 4096) = 192.423us
4096,21.2864,192.423
 Decompression
  Throughput = 143.899MB/s
  Latency (size = 4096) = 28.4645us
4096,143.899,28.4645
 Size = 8192
 Compression
  Compression ratio = 2.44109
  Throughput = 22.9597MB/s
  Latency (size = 8192) = 356.799us
8192,22.9597,356.799
 Decompression
  Throughput = 175.248MB/s
  Latency (size = 8192) = 46.7452us
8192,175.248,46.7452
 Size = 16384
 Compression
  Compression ratio = 2.56997
  Throughput = 22.1722MB/s
  Latency (size = 16384) = 738.942us
16384,22.1722,738.942
 Decompression
  Throughput = 206.567MB/s
  Latency (size = 16384) = 79.3158us
16384,206.567,79.3158
 Size = 32768
 Compression
  Compression ratio = 2.67076
  Throughput = 19.6633MB/s
  Latency (size = 32768) = 1666.46us
32768,19.6633,1666.46
 Decompression
  Throughput = 229.605MB/s
  Latency (size = 32768) = 142.715us
32768,229.605,142.715
 Size = 65536
 Compression
  Compression ratio = 2.74245
  Throughput = 17.4527MB/s
  Latency (size = 65536) = 3755.06us
65536,17.4527,3755.06
[...]

Bug: 907489
Change-Id: I71654f91980ad10f1b43fcb774bfb3808bffdaf4
Reviewed-on: https://chromium-review.googlesource.com/c/1352175
Reviewed-by: Egor Pasko <pasko@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#612198}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5d61d204beeee2263f7170efcdfbc8535ce1a5e6
1 file changed