We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af94f4b commit e2111b8Copy full SHA for e2111b8
1 file changed
parser/bench_test.go
@@ -0,0 +1,20 @@
1
+package parser
2
+
3
+import "testing"
4
5
+func BenchmarkParser(b *testing.B) {
6
+ const source = `
7
+ /*
8
+ Showing worst case scenario
9
+ */
10
+ let value = trim("contains escapes \n\"\\ \U0001F600 and non ASCII ñ"); // inline comment
11
+ len(value) == 0x2A
12
+ // let's introduce an error too
13
+ whatever
14
+ `
15
+ b.ReportAllocs()
16
+ p := new(Parser)
17
+ for i := 0; i < b.N; i++ {
18
+ p.Parse(source, nil)
19
+ }
20
+}
0 commit comments