• Martin Möhrmann's avatar
    bytes: improve WriteRune performance · 2321895f
    Martin Möhrmann authored
    Remove the runeBytes buffer and write the utf8 encoding directly
    to the internal buf byte slice.
    
    name         old time/op   new time/op   delta
    WriteRune-4   80.5µs ± 2%   57.1µs ± 2%  -29.06%  (p=0.000 n=20+20)
    
    name         old speed     new speed     delta
    WriteRune-4  153MB/s ± 2%  215MB/s ± 2%  +40.96%  (p=0.000 n=20+20)
    
    Change-Id: Ic15f6e2d6e56a3d15c74f56159e2eae020ba73ba
    Reviewed-on: https://go-review.googlesource.com/28816Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    2321895f
buffer_test.go 13.7 KB