[#1619] logger: Update benchmark
All checks were successful
DCO action / DCO (pull_request) Successful in 40s
Vulncheck / Vulncheck (pull_request) Successful in 1m0s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m28s
Build / Build Components (pull_request) Successful in 1m57s
Tests and linters / gopls check (pull_request) Successful in 3m42s
Tests and linters / Run gofumpt (pull_request) Successful in 4m55s
Tests and linters / Staticcheck (pull_request) Successful in 5m53s
Tests and linters / Lint (pull_request) Successful in 6m3s
Tests and linters / Tests (pull_request) Successful in 6m1s
Tests and linters / Tests with -race (pull_request) Successful in 6m46s
All checks were successful
DCO action / DCO (pull_request) Successful in 40s
Vulncheck / Vulncheck (pull_request) Successful in 1m0s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m28s
Build / Build Components (pull_request) Successful in 1m57s
Tests and linters / gopls check (pull_request) Successful in 3m42s
Tests and linters / Run gofumpt (pull_request) Successful in 4m55s
Tests and linters / Staticcheck (pull_request) Successful in 5m53s
Tests and linters / Lint (pull_request) Successful in 6m3s
Tests and linters / Tests (pull_request) Successful in 6m1s
Tests and linters / Tests with -race (pull_request) Successful in 6m46s
Change-Id: I04121a0550b3cdd8b8655fdeb2c5e0d062a96404 Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
b0cf6f51c0
commit
e20df71798
2 changed files with 94 additions and 22 deletions
|
@ -40,3 +40,39 @@ func BenchmarkLoggerError(b *testing.B) {
|
|||
logger.Error(ctx, "test error")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLoggerLevelLess(b *testing.B) {
|
||||
ctx := context.Background()
|
||||
prm := Prm{}
|
||||
require.NoError(b, prm.SetLevelString("info"))
|
||||
require.NoError(b, prm.SetTags([][]string{{"main", "debug"}, {"morph", "debug"}}))
|
||||
logger, err := NewLogger(prm)
|
||||
require.NoError(b, err)
|
||||
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
for range b.N {
|
||||
logger.Debug(ctx, "test debug")
|
||||
logger.Info(ctx, "test info")
|
||||
logger.Warn(ctx, "test warn")
|
||||
logger.Error(ctx, "test error")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkLoggerLevelGreater(b *testing.B) {
|
||||
ctx := context.Background()
|
||||
prm := Prm{}
|
||||
require.NoError(b, prm.SetLevelString("debug"))
|
||||
require.NoError(b, prm.SetTags([][]string{{"main", "error"}, {"morph", "debug"}}))
|
||||
logger, err := NewLogger(prm)
|
||||
require.NoError(b, err)
|
||||
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
for range b.N {
|
||||
logger.Debug(ctx, "test debug")
|
||||
logger.Info(ctx, "test info")
|
||||
logger.Warn(ctx, "test warn")
|
||||
logger.Error(ctx, "test error")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,33 +3,69 @@ goos: linux
|
|||
goarch: amd64
|
||||
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger
|
||||
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
|
||||
10000 526.5 ns/op 22 B/op 0 allocs/op
|
||||
10000 528.7 ns/op 23 B/op 0 allocs/op
|
||||
10000 527.1 ns/op 22 B/op 0 allocs/op
|
||||
10000 514.7 ns/op 22 B/op 0 allocs/op
|
||||
10000 545.2 ns/op 23 B/op 0 allocs/op
|
||||
10000 517.8 ns/op 23 B/op 0 allocs/op
|
||||
10000 518.0 ns/op 23 B/op 0 allocs/op
|
||||
10000 559.1 ns/op 23 B/op 0 allocs/op
|
||||
10000 644.6 ns/op 23 B/op 0 allocs/op
|
||||
10000 521.0 ns/op 23 B/op 0 allocs/op
|
||||
10000 534.6 ns/op 23 B/op 0 allocs/op
|
||||
10000 530.9 ns/op 23 B/op 0 allocs/op
|
||||
10000 667.4 ns/op 23 B/op 0 allocs/op
|
||||
10000 582.2 ns/op 23 B/op 0 allocs/op
|
||||
10000 530.7 ns/op 23 B/op 0 allocs/op
|
||||
10000 666.8 ns/op 23 B/op 0 allocs/op
|
||||
10000 533.1 ns/op 23 B/op 0 allocs/op
|
||||
10000 531.8 ns/op 23 B/op 0 allocs/op
|
||||
10000 529.5 ns/op 22 B/op 0 allocs/op
|
||||
10000 645.0 ns/op 23 B/op 0 allocs/op
|
||||
PASS
|
||||
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger 0.065s
|
||||
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger 0.069s
|
||||
|
||||
BenchmarkLoggerError
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger
|
||||
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
|
||||
10000 209.3 ns/op 6 B/op 0 allocs/op
|
||||
10000 213.7 ns/op 6 B/op 0 allocs/op
|
||||
10000 186.4 ns/op 6 B/op 0 allocs/op
|
||||
10000 193.0 ns/op 6 B/op 0 allocs/op
|
||||
10000 181.0 ns/op 6 B/op 0 allocs/op
|
||||
10000 177.6 ns/op 6 B/op 0 allocs/op
|
||||
10000 181.7 ns/op 6 B/op 0 allocs/op
|
||||
10000 183.8 ns/op 6 B/op 0 allocs/op
|
||||
10000 190.2 ns/op 6 B/op 0 allocs/op
|
||||
10000 185.0 ns/op 6 B/op 0 allocs/op
|
||||
10000 137.3 ns/op 6 B/op 0 allocs/op
|
||||
10000 144.2 ns/op 6 B/op 0 allocs/op
|
||||
10000 137.5 ns/op 6 B/op 0 allocs/op
|
||||
10000 142.6 ns/op 6 B/op 0 allocs/op
|
||||
10000 136.3 ns/op 6 B/op 0 allocs/op
|
||||
10000 137.0 ns/op 6 B/op 0 allocs/op
|
||||
10000 144.0 ns/op 6 B/op 0 allocs/op
|
||||
10000 152.6 ns/op 6 B/op 0 allocs/op
|
||||
10000 136.4 ns/op 6 B/op 0 allocs/op
|
||||
10000 137.9 ns/op 6 B/op 0 allocs/op
|
||||
PASS
|
||||
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger 0.030s
|
||||
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger 0.024s
|
||||
|
||||
BenchmarkLoggerLevelLess
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger
|
||||
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
|
||||
10000 554.3 ns/op 23 B/op 0 allocs/op
|
||||
10000 630.1 ns/op 23 B/op 0 allocs/op
|
||||
10000 642.0 ns/op 23 B/op 0 allocs/op
|
||||
10000 548.0 ns/op 23 B/op 0 allocs/op
|
||||
10000 562.7 ns/op 23 B/op 0 allocs/op
|
||||
10000 572.7 ns/op 23 B/op 0 allocs/op
|
||||
10000 552.1 ns/op 23 B/op 0 allocs/op
|
||||
10000 555.4 ns/op 23 B/op 0 allocs/op
|
||||
10000 546.0 ns/op 23 B/op 0 allocs/op
|
||||
10000 561.0 ns/op 22 B/op 0 allocs/op
|
||||
PASS
|
||||
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger 0.069s
|
||||
|
||||
BenchmarkLoggerLevelGreater
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger
|
||||
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
|
||||
10000 159.6 ns/op 6 B/op 0 allocs/op
|
||||
10000 161.9 ns/op 6 B/op 0 allocs/op
|
||||
10000 161.4 ns/op 6 B/op 0 allocs/op
|
||||
10000 160.9 ns/op 6 B/op 0 allocs/op
|
||||
10000 166.9 ns/op 6 B/op 0 allocs/op
|
||||
10000 163.9 ns/op 6 B/op 0 allocs/op
|
||||
10000 163.4 ns/op 6 B/op 0 allocs/op
|
||||
10000 158.7 ns/op 6 B/op 0 allocs/op
|
||||
10000 173.2 ns/op 6 B/op 0 allocs/op
|
||||
10000 160.7 ns/op 6 B/op 0 allocs/op
|
||||
PASS
|
||||
ok git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger 0.028s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue