hibernate-validator icon indicating copy to clipboard operation
hibernate-validator copied to clipboard

[HV-1928] reduces calls to isSubPathOf

Open thst71 opened this issue 2 years ago • 3 comments

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.

thst71 avatar Oct 31 '23 17:10 thst71

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.

thst71 avatar Nov 02 '23 14:11 thst71

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

thst71 avatar Nov 07 '23 21:11 thst71

@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."

yrodiere avatar Jun 13 '24 08:06 yrodiere

+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!

marko-bekhta avatar Jun 13 '24 12:06 marko-bekhta