• Nigel Tao's avatar
    compress/flate: benchmark some English text, not just the digits of e. · ffd0d02d
    Nigel Tao authored
    The testdata/e.txt input is repeated on the longer benchmarks, but the
    length of that data is less than flate's window size, so the numbers are
    essentially measuring the performance of a trivial compression. A follow-up
    CL will add more data to testdata/e.txt.
    
    Sample output on my laptop (linux, amd64):
    
    BenchmarkDecodeDigitsSpeed1e4	    5000	    603153 ns/op	  16.58 MB/s
    BenchmarkDecodeDigitsSpeed1e5	    1000	   1465602 ns/op	  68.23 MB/s
    BenchmarkDecodeDigitsSpeed1e6	     200	   8036050 ns/op	 124.44 MB/s
    BenchmarkDecodeDigitsDefault1e4	    5000	    581796 ns/op	  17.19 MB/s
    BenchmarkDecodeDigitsDefault1e5	    2000	    846653 ns/op	 118.11 MB/s
    BenchmarkDecodeDigitsDefault1e6	     500	   3385782 ns/op	 295.35 MB/s
    BenchmarkDecodeDigitsCompress1e4	    5000	    581180 ns/op	  17.21 MB/s
    BenchmarkDecodeDigitsCompress1e5	    2000	    846209 ns/op	 118.17 MB/s
    BenchmarkDecodeDigitsCompress1e6	     500	   3386174 ns/op	 295.32 MB/s
    BenchmarkDecodeTwainSpeed1e4	    5000	    643563 ns/op	  15.54 MB/s
    BenchmarkDecodeTwainSpeed1e5	     500	   5418408 ns/op	  18.46 MB/s
    BenchmarkDecodeTwainSpeed1e6	      50	  52277520 ns/op	  19.13 MB/s
    BenchmarkDecodeTwainDefault1e4	    5000	    583551 ns/op	  17.14 MB/s
    BenchmarkDecodeTwainDefault1e5	     500	   4443428 ns/op	  22.51 MB/s
    BenchmarkDecodeTwainDefault1e6	      50	  41862080 ns/op	  23.89 MB/s
    BenchmarkDecodeTwainCompress1e4	    5000	    583490 ns/op	  17.14 MB/s
    BenchmarkDecodeTwainCompress1e5	     500	   4426356 ns/op	  22.59 MB/s
    BenchmarkDecodeTwainCompress1e6	      50	  41657940 ns/op	  24.01 MB/s
    BenchmarkEncodeDigitsSpeed1e4	    2000	   1230907 ns/op	   8.12 MB/s
    BenchmarkEncodeDigitsSpeed1e5	    1000	   2319129 ns/op	  43.12 MB/s
    BenchmarkEncodeDigitsSpeed1e6	     100	  12378950 ns/op	  80.78 MB/s
    BenchmarkEncodeDigitsDefault1e4	    1000	   1597865 ns/op	   6.26 MB/s
    BenchmarkEncodeDigitsDefault1e5	     500	   3163458 ns/op	  31.61 MB/s
    BenchmarkEncodeDigitsDefault1e6	     100	  18770240 ns/op	  53.28 MB/s
    BenchmarkEncodeDigitsCompress1e4	    1000	   1603461 ns/op	   6.24 MB/s
    BenchmarkEncodeDigitsCompress1e5	     500	   3168766 ns/op	  31.56 MB/s
    BenchmarkEncodeDigitsCompress1e6	     100	  18855830 ns/op	  53.03 MB/s
    BenchmarkEncodeTwainSpeed1e4	    1000	   1338049 ns/op	   7.47 MB/s
    BenchmarkEncodeTwainSpeed1e5	     500	   7341622 ns/op	  13.62 MB/s
    BenchmarkEncodeTwainSpeed1e6	      50	  67484600 ns/op	  14.82 MB/s
    BenchmarkEncodeTwainDefault1e4	    1000	   1778399 ns/op	   5.62 MB/s
    BenchmarkEncodeTwainDefault1e5	     100	  23261810 ns/op	   4.30 MB/s
    BenchmarkEncodeTwainDefault1e6	      10	 243533600 ns/op	   4.11 MB/s
    BenchmarkEncodeTwainCompress1e4	    1000	   1795469 ns/op	   5.57 MB/s
    BenchmarkEncodeTwainCompress1e5	      50	  29447140 ns/op	   3.40 MB/s
    BenchmarkEncodeTwainCompress1e6	       5	 321686800 ns/op	   3.11 MB/s
    ok  	compress/flate	89.246s
    
    R=rsc, r
    CC=golang-dev
    https://golang.org/cl/6195055
    ffd0d02d
writer_test.go 2.51 KB