Skip to content
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

[HV-1928] reduces calls to isSubPathOf #1333

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thst71
Copy link

@thst71 thst71 commented Oct 31, 2023

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.

Copy link
Member

@marko-bekhta marko-bekhta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Thomas!

Thanks for taking a look into this. I've added a couple of comments inline.
Have you tried to run your case with this patch applied and if so did that help with performance?

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.

@thst71
Copy link
Author

thst71 commented Nov 2, 2023

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.

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Nov 3, 2023

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@thst71
Copy link
Author

thst71 commented Nov 7, 2023

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

Copy link
Member

@marko-bekhta marko-bekhta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good, please see an inline question. And maybe you could squash some of the commits? we usually try to squash the changes if we iterate on an improvement once we are done with it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants