Pre allocate LinkedHashMap in TopNNumericResultBuilder

This commit is contained in:
Charles Allen 2014-11-07 10:56:49 -08:00
parent bc92de233c
commit b4893b4490
1 changed files with 2 additions and 2 deletions

View File

@ -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);