Sanne Grinovero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjk4ODVhNTdi...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-16428?atlOrigin=eyJpIjoiMjk4OD...
) HHH-16428 (
https://hibernate.atlassian.net/browse/HHH-16428?atlOrigin=eyJpIjoiMjk4OD...
) Iteration optimisation in implementation of EntityGraphs#areEqual (
https://hibernate.atlassian.net/browse/HHH-16428?atlOrigin=eyJpIjoiMjk4OD...
)
Issue Type: Improvement Assignee: Unassigned Components: hibernate-core Created:
03/Apr/2023 14:55 PM Fix Versions: 6.wishlist Labels: performance Priority: Minor
Reporter: Sanne Grinovero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Spotted via code inspection: method
org.hibernate.graph.EntityGraphs#areEqual(java.util.Map<java.lang.Class,jakarta.persistence.Subgraph>,
java.util.Map<java.lang.Class,jakarta.persistence.Subgraph>)
is essentially comparing two entry sets, but attemtping an upfront equals check on all
keys and then iterating on each key and again comparing for existence on the second set,
followed by value lookup of both keys.
I’d suggest reduing the O of iterations; it seems the value lookup could be more expensive
than the initial checks so perhaps a two-pass iteration is in order.
(
https://hibernate.atlassian.net/browse/HHH-16428#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16428#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#100221- sha1:d541bce )