Guillaume Smet (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HV-1928 (
https://hibernate.atlassian.net/browse/HV-1928?atlOrigin=eyJpIjoiZThhYmYw...
)
Re: Bad validator performance when adding obsolete @Validated to Java value objects (
https://hibernate.atlassian.net/browse/HV-1928?atlOrigin=eyJpIjoiZThhYmYw...
)
I’m not sure “obsolete” is the right word. @Valid was always supposed to only be used to
cascade the validation to beans. You should only use it when you want the validation to
cascade. The way you used it has always been not recommended at all.
I’m not sure we can really ignore internal types as we could imagine someone adding
constraints to these types via the programmatic API. Even if it’s far fetched, it would
still be a valid use case of Hibernate Validator.
Now I wonder if we could optimize the case if we don’t have any constraints for this
particular class. I’m not sure we have the information when gathering the metadata
though.
And really, you shouldn’t have used @Valid in the first place so that’s an easy fix.
We are making progress to disable bean tracking in certain cases but it will only be
doable for projects using Quarkus (or a similar infrastructure) as it requires to live in
a closed world assumption and have the list of all the potentially validated beans.
Now, it might be a good idea to run your benchmark with async profiler and share the flame
graphs. There might be some improvements we could do.
(
https://hibernate.atlassian.net/browse/HV-1928#add-comment?atlOrigin=eyJp...
) Add Comment (
https://hibernate.atlassian.net/browse/HV-1928#add-comment?atlOrigin=eyJp...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:ffe1a02 )