The various HashMap<Class,Callback[]> managed by CallbackRegistryImpl have been identified as having a disproportionate cost to efficiency, compared to other areas. It would seem worthwhile to explore some options, perhaps:
- use a different data structure to maintain the mapping
- store some very hot data within the EntityPersister
And not limited to these ideas. This in particular shows as very hot in a benchmark performing many updates: {{Object java.util.HashMap.get(Object) 97 62.6 %}} {{ void org.hibernate.jpa.event.internal.CallbackRegistryImpl.postUpdate(Object) 24 15.5 %}} |