This is a pretty decent benchmark of the baseline event cost.
Change-Id: I22a7fa3411bd80be3bd8093d5933e29062cb1377
Reviewed-on: https://go-review.googlesource.com/c/go/+/723060
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
import (
"context"
+ "io"
. "runtime/trace"
"testing"
)
}
})
}
+
+func BenchmarkLog(b *testing.B) {
+ b.ReportAllocs()
+
+ Start(io.Discard)
+ defer Stop()
+
+ ctx := context.Background()
+ for b.Loop() {
+ Log(ctx, "", "")
+ }
+}