MCPcopy Create free account
hub / github.com/cel-expr/cel-go / BenchmarkResolverCustomQualifier

Function BenchmarkResolverCustomQualifier

interpreter/attributes_test.go:1457–1475  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1455}
1456
1457func BenchmarkResolverCustomQualifier(b *testing.B) {
1458 reg := newTestRegistry(b)
1459 attrs := &custAttrFactory{
1460 AttributeFactory: NewAttributeFactory(containers.DefaultContainer, reg, reg),
1461 }
1462 msg := &proto3pb.TestAllTypes_NestedMessage{
1463 Bb: 123,
1464 }
1465 vars, _ := NewActivation(map[string]any{
1466 "msg": msg,
1467 })
1468 attr := attrs.AbsoluteAttribute(1, "msg")
1469 fieldType := types.NewObjectType("google.expr.proto3.test.TestAllTypes.NestedMessage")
1470 qualBB := makeQualifier(b, attrs, fieldType, 2, "bb")
1471 attr.AddQualifier(qualBB)
1472 for i := 0; i < b.N; i++ {
1473 attr.Resolve(vars)
1474 }
1475}
1476
1477type custAttrFactory struct {
1478 AttributeFactory

Callers

nothing calls this directly

Calls 8

NewObjectTypeFunction · 0.92
NewAttributeFactoryFunction · 0.85
makeQualifierFunction · 0.85
newTestRegistryFunction · 0.70
NewActivationFunction · 0.70
AbsoluteAttributeMethod · 0.65
AddQualifierMethod · 0.65
ResolveMethod · 0.65

Tested by

no test coverage detected