hibernate-validator
hibernate-validator copied to clipboard
[HV-1928] reduces calls to isSubPathOf
https://hibernate.atlassian.net/browse/HV-1928
does not fix the issue but reduces the calls to isSubPathOf by one.
Refactors isSubPathOf() to pathsSharePrefix() to make the semantic change clear.
Have you tried to run your case with this patch applied and if so did that help with performance?
Yes, but as it didn't finish in time for hours before, and it didn't finish with the patch, I cannot say if I gained anything as it did not terminate. 🤷
By the way, we have some simple JMH performance tests (e.g. this one https://github.com/hibernate/hibernate-validator/blob/main/performance/src/main/java/org/hibernate/validator/performance/cascaded/CascadedWithLotsOfItemsValidation.java) that we are using to verify our performance improvement experiments. It would be nice if you can compare the results of existing and patched versions, and maybe try to add a case similar to yours.
That is a very good info, I was looking for such a thing.
Thanks for your pull request!
This pull request appears to follow the contribution rules.
› This message was automatically generated.
Hi Marko,
I did some more tweaks and have now a version that is substantially faster than before using your tests.
Attached, you find the measurements.
| Test | HV-1928 | Main |
|---|---|---|
| testCascadedValidation | 2718 | 2351 |
| testCascadedValidationWithLotsOfItems | 7511 | 7579 |
| testSimpleBeanValidation | 13863 | 11747 |
@marko-bekhta Should we move this to a separate Jira issue? Since the main description says "does not fix the issue but reduces the calls to isSubPathOf by one."
+1 I've opened https://hibernate.atlassian.net/browse/HV-1993 and created a rebased version of this PR here https://github.com/hibernate/hibernate-validator/pull/1356
I'll close this PR now.
Thanks @thst71 for working on this!