• Joe Tsai's avatar
    compress/bzip2: fix benchmark to actually measure decompression rate · ff274210
    Joe Tsai authored
    Motivation:
    * Previously, the size of the compressed data was used for metrics,
    rather than the uncompressed size. This causes the library to appear
    to perform poorly relative to C or other implementation. Switch it
    to use the uncompressed size so that it matches how decompression
    benchmarks are usually done (like in compress/flate). This also makes
    it easier to compare bzip2 rates to other algorithms since they measure
    performance in this way.
    * Also, reset the timer after doing initialization work.
    
    Change-Id: I32112c2ee8e7391e658c9cf31039f70a689d9b9d
    Reviewed-on: https://go-review.googlesource.com/17611Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    ff274210
bzip2_test.go 29.7 KB