Skip to content

test: add comprehensive benchmark suite#18

Merged
taigrr merged 1 commit into
masterfrom
burrow/6-add-benchmarks
Feb 17, 2026
Merged

test: add comprehensive benchmark suite#18
taigrr merged 1 commit into
masterfrom
burrow/6-add-benchmarks

Conversation

@taigrr
Copy link
Copy Markdown
Owner

@taigrr taigrr commented Feb 17, 2026

Fixes #6

Changes

  • Added log/bench_test.go with 13 benchmarks covering:
    • Client creation/destruction overhead
    • All log levels (Trace, Debug, Info, Warn, Error)
    • Formatted logging (Tracef, Infof)
    • Multiple client fan-out (5 consumers)
    • Parallel concurrent writes
    • Namespace filtering performance
    • Component-level: fileInfo (runtime.Caller) and entry creation baselines

Key Findings

  • ~1.0-1.2μs per log entry (single client, single goroutine)
  • ~2.6μs with 5 client fan-out
  • runtime.Caller accounts for ~65% of per-entry cost
  • Namespace filtering saves ~20% when messages are filtered out
  • 6 allocs/op for standard log calls, 7 for formatted variants

Testing

go test ./log/ -bench=. -benchmem

Adds benchmarks for all log levels (Trace, Debug, Info, Warn, Error),
formatted logging, multiple client fan-out, parallel writes, namespace
filtering, and component-level benchmarks (fileInfo, entry creation).

Uses isolated namespaces to avoid interference with the stderr client.

Fixes #6
@taigrr taigrr merged commit 0a78d1c into master Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add benchmarks

1 participant