go/benchmark

Benchmarking

Run Go benchmarks

go
benchmark
performance

Command

go test -bench=.

Explanation

Run Go benchmarks to measure and compare performance of different implementations.

Examples

Run all benchmarks

go test -bench=.

Run specific benchmark

go test -bench=BenchmarkFunction

Run with memory stats

go test -bench=. -benchmem