From 66515a2e4e9ac312b58575fdc6dcdce9dacc27ea Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Mon, 4 Nov 2019 12:09:00 +0000 Subject: [PATCH] HHH-13723 Hint sizing of ArrayList in ResultSetProcessingContextImpl --- .../exec/process/internal/ResultSetProcessingContextImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java index 791132e67d..8b9cfe8486 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/internal/ResultSetProcessingContextImpl.java @@ -281,8 +281,9 @@ public class ResultSetProcessingContextImpl implements ResultSetProcessingContex // managing the running list of registrations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + final int sizeHint = currentRowHydratedEntityRegistrationList.size(); if ( hydratedEntityRegistrationList == null ) { - hydratedEntityRegistrationList = new ArrayList<>(); + hydratedEntityRegistrationList = new ArrayList<>( sizeHint ); } hydratedEntityRegistrationList.addAll( currentRowHydratedEntityRegistrationList );