test(log): add comprehensive benchmarks#17
Closed
taigrr wants to merge 1 commit into
Closed
Conversation
Adds a new benchmark_test.go file with comprehensive benchmarks for the logging library: Serial benchmarks: - Trace, Debug, Info, Notice, Warn, Error levels Formatted logging: - Debugf, Infof, Errorf variants Parallel benchmarks: - DebugParallel, InfoParallel, InfofParallel Logger instance (namespaced): - LoggerInfo, LoggerInfof, LoggerDebugParallel Multiple clients/namespaces: - MultipleClients, MultipleNamespaces Message size comparison: - Short, Medium, Long messages Level filtering overhead: - DebugFilteredByLevel Also removes the duplicate BenchmarkDebugSerial from log_test.go and applies minor whitespace formatting fixes. Fixes #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive benchmarks for the log-socket library to help measure performance and track regressions.
Fixes #6
Benchmarks Added
Serial Benchmarks (Single Log Levels)
BenchmarkTrace,BenchmarkDebug,BenchmarkInfoBenchmarkNotice,BenchmarkWarn,BenchmarkErrorFormatted Logging
BenchmarkDebugf,BenchmarkInfof,BenchmarkErrorfParallel Benchmarks
BenchmarkDebugParallel,BenchmarkInfoParallel,BenchmarkInfofParallelLogger Instance (Namespaced Logging)
BenchmarkLoggerInfo,BenchmarkLoggerInfof,BenchmarkLoggerDebugParallelMultiple Clients/Namespaces
BenchmarkMultipleClients- measures overhead with multiple consumersBenchmarkMultipleNamespaces- measures namespaced logging performanceMessage Size Comparison
BenchmarkInfoShortMessage- 2 charsBenchmarkInfoMediumMessage- ~60 charsBenchmarkInfoLongMessage- ~250 charsLevel Filtering Overhead
BenchmarkDebugFilteredByLevel- measures overhead when logs are filteredSample Results (2 cores)
Other Changes
BenchmarkDebugSerialfrom log_test.go to the new benchmark file