Sanne Grinovero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzdhY2RlNTQz...
) / Task (
https://hibernate.atlassian.net/browse/HHH-15568?atlOrigin=eyJpIjoiYzdhY2...
) HHH-15568 (
https://hibernate.atlassian.net/browse/HHH-15568?atlOrigin=eyJpIjoiYzdhY2...
) Improve performance of runtime metamodel lookups by entity name (
https://hibernate.atlassian.net/browse/HHH-15568?atlOrigin=eyJpIjoiYzdhY2...
)
Issue Type: Task Assignee: Unassigned Created: 01/Oct/2022 14:05 PM Labels: performance
Priority: Major Reporter: Sanne Grinovero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
The class MappingMetamodelImpl is extremely hot during load, as a frequent operation is to
lookup EntityPersister based on entity name (a String). Same for collection’s persisters.
This is currently implemented using a ConcurrentHashMap , but I suspect could be optimised
further by taking advantage of the fact that we know all valid entity names after boot:
normally CHM is optimised for some balance of read and write operations, but we
effectively need an immutable data structure which is optimised for read operations: write
operations can be expensive as we’d compute the optimal data structure just once.
A simple idea could be to sort the strings, and then implement some form of binary search;
this theory is untested though - we should experiment.
(
https://hibernate.atlassian.net/browse/HHH-15568#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15568#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:ee9e30a )