Skip to content

Commit 860e31a

Browse files
joeybloggsjoeybloggs
authored andcommitted
Add benchmarks to README at others request
1 parent f0444d7 commit 860e31a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,24 @@ Why? because my time is spread pretty thin maintaining all of the libraries I ha
194194
it is so freeing not to worry about it and will help me keep pouring out bigger and better
195195
things for you the community.
196196

197+
Benchmarks
198+
----------
199+
###### Run on MacBook Pro (Retina, 15-inch, Late 2013) 2.6 GHz Intel Core i7 16 GB 1600 MHz DDR3 using Go version go1.6.2 darwin/amd64
200+
NOTE: only putting benchmarks at others request, by no means does the number of allocations
201+
make one log library better than another!
202+
```go
203+
go test -cpu=4 -bench=. -benchmem=true
204+
205+
PASS
206+
BenchmarkLogConsoleTenFieldsParallel-4 1000000 1930 ns/op 1113 B/op 35 allocs/op
207+
BenchmarkLogConsoleSimpleParallel-4 3000000 450 ns/op 88 B/op 4 allocs/op
208+
BenchmarkLogrusText10Fields-4 300000 3943 ns/op 4291 B/op 63 allocs/op
209+
BenchmarkLogrusTextSimple-4 2000000 633 ns/op 672 B/op 15 allocs/op
210+
BenchmarkLog1510Fields-4 100000 16375 ns/op 4378 B/op 92 allocs/op
211+
BenchmarkLog15Simple-4 1000000 1982 ns/op 320 B/op 9 allocs/op
212+
ok github.com/go-playground/log/benchmarks 10.716s
213+
```
214+
197215
Special Thanks
198216
--------------
199217
Special thanks to the following libraries that inspired

benchmarks/benchmark_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestMain(m *testing.M) {
6969
os.Exit(m.Run())
7070
}
7171

72-
func BenchmarkConsoleTenFieldsParallel(b *testing.B) {
72+
func BenchmarkLogConsoleTenFieldsParallel(b *testing.B) {
7373

7474
b.ResetTimer()
7575
// log setup in TestMain
@@ -92,7 +92,7 @@ func BenchmarkConsoleTenFieldsParallel(b *testing.B) {
9292
})
9393
}
9494

95-
func BenchmarkConsoleSimpleFieldsParallel(b *testing.B) {
95+
func BenchmarkLogConsoleSimpleParallel(b *testing.B) {
9696

9797
b.ResetTimer()
9898
// log setup in TestMain

0 commit comments

Comments
 (0)