Skip to content

Commit fb0e119

Browse files
authored
chore(stacktrace): Add parseSymbol benchmark (#4169)
Signed-off-by: Kemal Akkoyun <[email protected]>
1 parent 922bd28 commit fb0e119

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed
2+
// under the Apache License Version 2.0.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
// Copyright 2016 Datadog, Inc.
5+
6+
package stacktrace
7+
8+
import "testing"
9+
10+
func BenchmarkParseSymbol(b *testing.B) {
11+
testCases := []string{
12+
"github.com/DataDog/dd-trace-go/v2/internal/stacktrace.TestFunc",
13+
"github.com/DataDog/dd-trace-go/v2/internal/stacktrace.(*Event).NewException",
14+
"github.com/DataDog/dd-trace-go/v2/internal/stacktrace.TestFunc.func1",
15+
"os/exec.(*Cmd).Run.func1",
16+
"test.(*Test).Method",
17+
"test.main",
18+
}
19+
20+
b.ResetTimer()
21+
for i := 0; i < b.N; i++ {
22+
for _, tc := range testCases {
23+
_ = parseSymbol(tc)
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)