mirror of https://github.com/golang/go.git
Pre-allocate the slice of buf with enough capacity to avoid growslice calls. benchmark old ns/op new ns/op delta BenchmarkTimeString-4 493 409 -17.12% BenchmarkTimeGoString-4 309 182 -41.30% benchmark old allocs new allocs delta BenchmarkTimeString-4 5 3 -40.00% BenchmarkTimeGoString-4 4 1 -75.00% benchmark old bytes new bytes delta BenchmarkTimeString-4 152 128 -15.79% BenchmarkTimeGoString-4 248 80 -67.74% Change-Id: I64eabe2ab0b3d4a846453c2e8e548a831d720b8c Reviewed-on: https://go-review.googlesource.com/c/go/+/343971 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Alexander Rakoczy <alex@golang.org> |
||
|---|---|---|
| .. | ||
| testdata | ||
| tzdata | ||
| embed.go | ||
| example_test.go | ||
| export_android_test.go | ||
| export_test.go | ||
| export_windows_test.go | ||
| format.go | ||
| format_test.go | ||
| genzabbrs.go | ||
| internal_test.go | ||
| mono_test.go | ||
| sleep.go | ||
| sleep_test.go | ||
| sys_plan9.go | ||
| sys_unix.go | ||
| sys_windows.go | ||
| tick.go | ||
| tick_test.go | ||
| time.go | ||
| time_test.go | ||
| tzdata_test.go | ||
| zoneinfo.go | ||
| zoneinfo_abbrs_windows.go | ||
| zoneinfo_android.go | ||
| zoneinfo_android_test.go | ||
| zoneinfo_ios.go | ||
| zoneinfo_js.go | ||
| zoneinfo_plan9.go | ||
| zoneinfo_read.go | ||
| zoneinfo_test.go | ||
| zoneinfo_unix.go | ||
| zoneinfo_unix_test.go | ||
| zoneinfo_windows.go | ||
| zoneinfo_windows_test.go | ||