]> Cypherpunks repositories - gostls13.git/commit
go/format: add simple benchmark framework and basic benchmark
authorRobert Griesemer <gri@golang.org>
Wed, 12 Dec 2018 01:23:14 +0000 (17:23 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 12 Dec 2018 03:52:58 +0000 (03:52 +0000)
commit41d0dc49d2e6bfb96bd87c7a1ded9ed20b602281
treeb3ce4babd9461377ea8f798e18ac6c36b598b969
parentef780fbf1023e7a7569cb822bcafcc2252c6e25f
go/format: add simple benchmark framework and basic benchmark

For now, this CL adds as a first benchmark the formatting of
a 10,000 element array literal. It is easy to add additional
test cases as we see fit.

name                   time/op
Format/array1-10000-4    26.7ms ± 7%

name                   speed
Format/array1-10000-4  2.43MB/s ± 6%

name                   alloc/op
Format/array1-10000-4    5.52MB ± 0%

name                   allocs/op
Format/array1-10000-4      119k ± 0%

Updates #26528.

Change-Id: Ic8ec8f70160d122b877740412d4d4406f5f4b345
Reviewed-on: https://go-review.googlesource.com/c/153642
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/go/format/benchmark_test.go [new file with mode: 0644]