benchmarks

package standard library
go1.27.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package benchmarks contains benchmarks for slog.

These benchmarks are loosely based on github.com/uber-go/zap/benchmarks. They have the following desirable properties:

  • They test a complete log event, from the user's call to its return.

  • The benchmarked code is run concurrently in multiple goroutines, to better simulate a real server (the most common environment for structured logs).

  • Some handlers are optimistic versions of real handlers, doing real-world tasks as fast as possible (and sometimes faster, in that an implementation may not be concurrency-safe). This gives us an upper bound on handler performance, so we can evaluate the (handler-independent) core activity of the package in an end-to-end context without concern that a slow handler implementation is skewing the results.

  • We also test the built-in handlers, for comparison.

Jump to

Keyboard shortcuts

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