package benchmarks
Import Path
log/slog/internal/benchmarks (on go.dev)
Dependency Relation
imports 8 packages, and imported by 0 packages
Involved Source Files
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.
handlers.go
The pages are generated with Golds v0.7.0-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |