-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: Improve predicateConditional Matches performance #365
Comments
xref #198 |
Edit:
|
In our scenario, predicate matches in a hot path and causes performance problems. the cost of
reflect.ValueOf(c.predicate).Call([]reflect.Value{reflect.ValueOf(m)})
is quite expensive.The predicate is expected to be like
func (model.Model) bool
Egfunc (lsp *LogicalSwitchPort) bool { return lsp.Name == "lorem" }
. We are trying to eliminate the reflect here. Any suggestions?https://github.com/ovn-org/libovsdb/blob/main/client/condition.go#L194-L197
I suppose we could change client API
to
And model API, GetTableName function could add to modelgen tmpl.
To get the table name from the predicate
to
Then Matches could refactor to
The text was updated successfully, but these errors were encountered: