From ab3f245e0d9a835801a56a1cfc1aa44140ab4c7e Mon Sep 17 00:00:00 2001 From: Luuk Paulussen Date: Thu, 26 Oct 2023 15:09:03 +1300 Subject: [PATCH] Remove bottleneck in validation (#923) Even with debugLibrary not enabled ValueStr is calculated in this call, which causes significant bottlenecks in validation. All other calls to DbgPrint already use ValueStrDebug to avoid formatting string output that won't ever be used. --- ytypes/validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ytypes/validate.go b/ytypes/validate.go index 4f563370d..351652208 100644 --- a/ytypes/validate.go +++ b/ytypes/validate.go @@ -96,7 +96,7 @@ func Validate(schema *yang.Entry, value interface{}, opts ...ygot.ValidationOpti } } - util.DbgPrint("Validate with value %v, type %T, schema name %s", util.ValueStr(value), value, schema.Name) + util.DbgPrint("Validate with value %v, type %T, schema name %s", util.ValueStrDebug(value), value, schema.Name) switch { case schema.IsLeaf():