mirror of https://github.com/apache/druid.git
loop unrolling provides no benefit for timeseries
This commit is contained in:
parent
e817db8b6c
commit
3f5449d40a
|
@ -60,28 +60,9 @@ public class TimeseriesQueryEngine
|
||||||
{
|
{
|
||||||
Aggregator[] aggregators = QueryRunnerHelper.makeAggregators(cursor, aggregatorSpecs);
|
Aggregator[] aggregators = QueryRunnerHelper.makeAggregators(cursor, aggregatorSpecs);
|
||||||
try {
|
try {
|
||||||
final int aggSize = aggregators.length;
|
|
||||||
final int aggExtra = aggSize % AGG_UNROLL_COUNT;
|
|
||||||
|
|
||||||
while (!cursor.isDone()) {
|
while (!cursor.isDone()) {
|
||||||
switch(aggExtra) {
|
for(Aggregator aggregator : aggregators) {
|
||||||
case 7: aggregators[6].aggregate();
|
aggregator.aggregate();
|
||||||
case 6: aggregators[5].aggregate();
|
|
||||||
case 5: aggregators[4].aggregate();
|
|
||||||
case 4: aggregators[3].aggregate();
|
|
||||||
case 3: aggregators[2].aggregate();
|
|
||||||
case 2: aggregators[1].aggregate();
|
|
||||||
case 1: aggregators[0].aggregate();
|
|
||||||
}
|
|
||||||
for (int j = aggExtra; j < aggSize; j += AGG_UNROLL_COUNT) {
|
|
||||||
aggregators[j].aggregate();
|
|
||||||
aggregators[j+1].aggregate();
|
|
||||||
aggregators[j+2].aggregate();
|
|
||||||
aggregators[j+3].aggregate();
|
|
||||||
aggregators[j+4].aggregate();
|
|
||||||
aggregators[j+5].aggregate();
|
|
||||||
aggregators[j+6].aggregate();
|
|
||||||
aggregators[j+7].aggregate();
|
|
||||||
}
|
}
|
||||||
cursor.advance();
|
cursor.advance();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue