The Go programming language
Switch branches/tags
Clone or download
griesemer 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-by: Ian Lance Taylor <>
Latest commit 41d0dc4 Dec 12, 2018

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at There is a mirror of the repository at

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at

After downloading a binary release, visit or load doc/install.html in your web browser for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit or load doc/install-source.html in your web browser for source installation instructions.


Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines:

Note that the Go project uses the issue tracker for bug reports and proposals only. See for a list of places to ask questions about the Go language.