Descriptioncmd/gc: avoid a temporary when inlining s = append(s, x)
pkg strconv:
benchmark old ns/op new ns/op delta
BenchmarkAppendFloatDecimal 203 198 -2.46%
BenchmarkAppendFloat 363 348 -4.13%
BenchmarkAppendFloatExp 335 307 -8.36%
BenchmarkAppendFloatNegExp 335 318 -5.07%
BenchmarkAppendFloatBig 526 480 -8.75%
BenchmarkAppendFloat32Integer 203 216 +6.40%
BenchmarkAppendFloat32ExactFraction 307 293 -4.56%
BenchmarkAppendFloat32Point 367 349 -4.90%
BenchmarkAppendFloat32Exp 318 302 -5.03%
BenchmarkAppendFloat32NegExp 322 306 -4.97%
BenchmarkAppendFloat64Fixed1 243 247 +1.65%
BenchmarkAppendFloat64Fixed2 283 293 +3.53%
BenchmarkAppendFloat64Fixed3 248 264 +6.45%
BenchmarkAppendFloat64Fixed4 287 277 -3.48%
BenchmarkAppendInt 5676 5640 -0.63%
BenchmarkAppendUint 1448 1445 -0.21%
pkg time:
benchmark old ns/op new ns/op delta
BenchmarkFormat 876 884 +0.91%
BenchmarkFormatNow 832 845 +1.56%
Stack size is reduced in many cases:
strconv before:
(src/pkg/strconv/ftoa.go:334) TEXT fmtE+0(SB),$344-120
(src/pkg/strconv/ftoa.go:401) TEXT fmtF+0(SB),$232-112
(src/pkg/strconv/quote.go:13) TEXT quoteWith+0(SB),$560-40
(src/pkg/strconv/quote.go:293) TEXT Unquote+0(SB),$200-48
strconv after:
(src/pkg/strconv/ftoa.go:334) TEXT fmtE+0(SB),$104-120
(src/pkg/strconv/ftoa.go:401) TEXT fmtF+0(SB),$88-112
(src/pkg/strconv/quote.go:13) TEXT quoteWith+0(SB),$208-40
(src/pkg/strconv/quote.go:293) TEXT Unquote+0(SB),$176-48
time before:
(src/pkg/time/format.go:290) TEXT appendUint+0(SB),$272-64
(src/pkg/time/format.go:341) TEXT formatNano+0(SB),$152-72
(src/pkg/time/format.go:382) TEXT Time.Format+0(SB),$720-56
time after:
(src/pkg/time/format.go:290) TEXT appendUint+0(SB),$200-64
(src/pkg/time/format.go:341) TEXT formatNano+0(SB),$128-72
(src/pkg/time/format.go:382) TEXT Time.Format+0(SB),$416-56
Patch Set 1 #Patch Set 2 : diff -r 30c566874b83 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 30c566874b83 https://go.googlecode.com/hg/ #
Total comments: 6
Patch Set 4 : diff -r bce231eb0fdd https://go.googlecode.com/hg/ #MessagesTotal messages: 11
|