Since reporting the issue, major performance improvements have been made and of the 4 test-cases attached to the ticket, 3 are now faster in v6. However, one of the tests is still significantly slower and seems to have major performance implications in our application:
Fetch Entities with Associations
Fetch Entities without Associations
Small Transactions Criteria
Small Transactions HQL
I just re-ran our mass indexer that issues hundreds of thousands of queries to rebuild our search index. Here are the results:
5.6.15: MassIndexerImpl - Finished updating index in 418s.
6.2.0-CR4: MassIndexerImpl - Finished updating index in 459s.
So H6 is roughly 10% slower than H5. A similar difference in performance can be seen in my minimal test case testFetchEntityWithAssociationsPerformance.
Hibernate 6 seems to do significantly more work to initialize associations than H5.
These PRs contain the performance tests against the various branches:
I tried profiling the testFetchEntityWithAssociationsPerformance test against main and 5.6, but there have been so many changes to the code between the two versions that it isn’t possible for me to determine the root cause of these regressions.
Can someone take another look at this? I think H6 has the potential to be significantly faster than H5, but the problem with associations currently makes it slower in our application.