• Martin Möhrmann's avatar
    fmt: optimize %x and %X formatting for byte slices and strings · 033e3e10
    Martin Möhrmann authored
    No extra buffering is needed to save the encoding
    since the left padding can be computed and written out
    before the encoding is generated.
    
    Add extra tests to both string and byte slice formatting.
    
    name                old time/op  new time/op  delta
    SprintfHexString-2   410ns ± 3%   194ns ± 3%  -52.60%  (p=0.000 n=20+19)
    SprintfHexBytes-2    431ns ± 3%   202ns ± 2%  -53.13%  (p=0.000 n=18+20)
    
    Change-Id: Ibca4316427c89f834e4faee61614493c7eedb42b
    Reviewed-on: https://go-review.googlesource.com/20097
    Run-TryBot: Rob Pike <r@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    033e3e10
Name
Last commit
Last update
..
doc.go Loading commit data...
export_test.go Loading commit data...
fmt_test.go Loading commit data...
format.go Loading commit data...
print.go Loading commit data...
scan.go Loading commit data...
scan_test.go Loading commit data...
stringer_test.go Loading commit data...