eaburns/T — pull request #29 by eaburns (2014-12-31 19:35:55+00:00)
Title: Simplify the buffer package.

Remove buffer.Bytes and buffer.Address. Revert back to the original, lower-level interface for buffer.Runes. Now each read and write doesn't need to pack and unpack little-endian runes into and out of bytes.
This gives a performance improvement on buffers, but doesn't seem to matter much for computing addresses:
benchmark old ns/op new ns/op delta
BenchmarkLinex32 397 408 +2.77%
BenchmarkLinex1K 15948 6764 -57.59%
BenchmarkRegexpEasy0x32 120831 117597 -2.68%
BenchmarkRegexpEasy0x1K 161237 142634 -11.54%
BenchmarkRegexpEasy1x32 95650 94051 -1.67%
BenchmarkRegexpEasy1x1K 140481 122397 -12.87%
BenchmarkRegexpMediumx32 18707 18472 -1.26%
BenchmarkRegexpMediumx1K 18700 18472 -1.22%
BenchmarkRegexpHardx32 18694 18574 -0.64%
BenchmarkRegexpHardx1K 19157 18435 -3.77%
BenchmarkWrite1 288 145 -49.65%
BenchmarkWrite1k 23039 243 -98.95%
BenchmarkWrite4k 64866 611 -99.06%
BenchmarkWrite10k 7127633 12145121 +70.39%
BenchmarkRead1 219 22.9 -89.54%
BenchmarkRead1k 41963 123 -99.71%
BenchmarkRead4k 134097 443 -99.67%
BenchmarkRead10k 7696096 5734288 -25.49%

benchmark old MB/s new MB/s speedup
BenchmarkLinex32 80.56 78.36 0.97x
BenchmarkLinex1K 64.21 151.38 2.36x
BenchmarkRegexpEasy0x32 0.26 0.27 1.04x
BenchmarkRegexpEasy0x1K 6.35 7.18 1.13x
BenchmarkRegexpEasy1x32 0.33 0.34 1.03x
BenchmarkRegexpEasy1x1K 7.29 8.37 1.15x
BenchmarkRegexpMediumx32 0.05 0.05 1.00x
BenchmarkRegexpMediumx1K 54.76 55.43 1.01x
BenchmarkRegexpHardx32 1.71 1.72 1.01x
BenchmarkRegexpHardx1K 53.45 55.55 1.04x
BenchmarkWrite1 13.87 27.43 1.98x
BenchmarkWrite1k 177.78 16852.01 94.79x
BenchmarkWrite4k 252.58 26796.53 106.09x
BenchmarkWrite10k 588.46 345.35 0.59x
BenchmarkRead1 18.19 175.04 9.62x
BenchmarkRead1k 97.61 33262.94 340.77x
BenchmarkRead4k 122.18 36930.90 302.27x
BenchmarkRead10k 544.99 731.44 1.34x