Skip to content

Commit

Permalink
Remove bottleneck in validation (#923)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
luukp authored Oct 26, 2023
1 parent 9e37362 commit ab3f245
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ytypes/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit ab3f245

Please sign in to comment.