Flight Recorder was showing Maps in areas like PersistenceContext, JdbcCoordinator, and BatchFetchQueue StatefulPersistenceContext to have hotspots involving Map#resize. It would be interesting to investigate adding some sort of "initial capacity" setting and use where applicable. Realistically, deciding to target only the StatefulPersistenceContext maps might make sense. The setting would involve "how many entities can you expect to manage in a single Session".
I am not suggesting that this be pervasive throughout core.
|