MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / BenchmarkParseEntityMap

Function BenchmarkParseEntityMap

xmlparser/entities_test.go:77–93  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

75}
76
77func BenchmarkParseEntityMap(b *testing.B) {
78 directive := &xmlparser.Directive{
79 Data: []byte(`<!DOCTYPE svg [
80 <!ENTITY entity1 "Value1">
81 <!ENTITY entity2 'Value2'>
82 <!ENTITY entity3 "Value with spaces">
83 ]>`),
84 }
85
86 nodes := []xmlparser.Token{directive}
87
88 b.ResetTimer()
89
90 for b.Loop() {
91 _ = xmlparser.ParseEntityMap(nodes)
92 }
93}
94
95func BenchmarkReplaceEntitiesString(b *testing.B) {
96 em := map[string][]byte{

Callers

nothing calls this directly

Calls 1

ParseEntityMapFunction · 0.92

Tested by

no test coverage detected