MCPcopy
hub / github.com/expr-lang/expr / BenchmarkParser

Function BenchmarkParser

parser/bench_test.go:5–20  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func 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}

Callers

nothing calls this directly

Calls 1

ParseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…