Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk/log: Change BenchmarkLoggerNewRecord to BenchmarkLoggerEmit (#6315)
I find having benchmark for `Emit` more useful than just for `newRecord`. It can be used to showcase the performance benefit of using `Enabled` even for a record with 10 attributes. ``` goos: linux goarch: amd64 pkg: go.opentelemetry.io/otel/sdk/log cpu: 13th Gen Intel(R) Core(TM) i7-13800H BenchmarkLoggerEmit/5_attributes-20 511827 2609 ns/op 41947 B/op 1 allocs/op BenchmarkLoggerEmit/10_attributes-20 1000000 3520 ns/op 46905 B/op 5 allocs/op BenchmarkLoggerEnabled-20 263691399 4.549 ns/op 0 B/op 0 allocs/op ``` --------- Co-authored-by: Damien Mathieu <[email protected]>
- Loading branch information