benchinit

command module
v0.0.0-...-4207428 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

README

benchinit

Benchmark the initialization cost of your packages or programs.

cd $(mktemp -d); go mod init tmp; go get mvdan.cc/benchinit

This includes the cost of init functions, plus initialising globals. In other words, a package's contribution to the slowness before main is run.

Requires Go 1.12 or later.

Quickstart

Benchmarking a single package is simple:

benchinit cmd/go

You can also include all dependencies in the benchmark:

benchinit -r cmd/go

Finally, like any other benchmark, you can pass in go test flags:

benchinit -r -count=5 -benchtime=2s cmd/go
Further reading

This tool was result of a discussion with @josharian. You can read more about Josh's idea in his blog post.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL