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

Function BenchmarkReplaceEntitiesString

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

Source from the content-addressed store, hash-verified

93}
94
95func BenchmarkReplaceEntitiesString(b *testing.B) {
96 em := map[string][]byte{
97 "entity1": []byte("Entity Value1"),
98 "entity2": []byte("Entity Value2"),
99 "entity3": []byte("Entity Value3"),
100 }
101
102 data := "This is a test string with &entity1;, &entity2;, and &entity3; to be replaced."
103
104 b.ResetTimer()
105
106 for b.Loop() {
107 _ = xmlparser.ReplaceEntitiesString(data, em)
108 }
109}
110
111func BenchmarkReplaceEntitiesBytes(b *testing.B) {
112 em := map[string][]byte{

Callers

nothing calls this directly

Calls 1

ReplaceEntitiesStringFunction · 0.92

Tested by

no test coverage detected