I've noticed [MetamodelImpl.getImplementors|https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetamodelImpl.java#L544] method is invoked whenever a criteria is [executed with list()|https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java#L1863] , getImplentors is iterating over all entity persisters available (>600 in my model) to resolve the implementors for a given class name, finally this causes a considerable overhead.
Given the implementors for a concrete class name would always be the same. It would be convenient to cache it.
Discussed in forums: https://forum.hibernate.org/viewtopic.php?f=1&t=1044025 |
|