mirror of https://github.com/apache/druid.git
Pre allocate LinkedHashMap in TopNNumericResultBuilder
This commit is contained in:
parent
bc92de233c
commit
b4893b4490
|
@ -21,7 +21,6 @@ package io.druid.query.topn;
|
|||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.druid.query.Result;
|
||||
import io.druid.query.aggregation.AggregatorFactory;
|
||||
import io.druid.query.aggregation.AggregatorUtil;
|
||||
|
@ -32,6 +31,7 @@ import org.joda.time.DateTime;
|
|||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.PriorityQueue;
|
||||
|
@ -115,7 +115,7 @@ public class TopNNumericResultBuilder implements TopNResultBuilder
|
|||
Object[] metricVals
|
||||
)
|
||||
{
|
||||
final Map<String, Object> metricValues = Maps.newLinkedHashMap();
|
||||
final Map<String, Object> metricValues = new LinkedHashMap<>(metricVals.length + postAggs.size());
|
||||
|
||||
metricValues.put(dimSpec.getOutputName(), dimName);
|
||||
|
||||
|
|
Loading…
Reference in New Issue