From 8d0be0073ba105608bd3ff5029f0d190267272e8 Mon Sep 17 00:00:00 2001 From: Peter Veentjer Date: Tue, 14 Jul 2020 11:54:07 +0300 Subject: [PATCH] There is a very severe performance issue with JDK 8 in combination with the paging predicate. This is caused by SubList.sort. This issue is resolved with JDK9 but we need to fix the issue for a large number of people using JDK 8 The problem is fixed by switching from LinkedList to ArrayList in the QueryResult. Benchmarks are included in the ticket fix #17207 --- .../main/java/com/hazelcast/map/impl/query/QueryResult.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryResult.java b/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryResult.java index d41f9d8c9010..9184403f4147 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryResult.java +++ b/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryResult.java @@ -32,7 +32,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -60,7 +59,7 @@ */ public class QueryResult implements Result, Iterable { - private List rows = new LinkedList(); + private List rows = new ArrayList(); private Collection partitionIds; private IterationType iterationType;