• 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
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...