loop unrolling provides no benefit for timeseries

This commit is contained in:
Xavier Léauté 2014-11-11 10:58:37 -08:00
parent e817db8b6c
commit 3f5449d40a
1 changed files with 2 additions and 21 deletions

View File

@ -60,28 +60,9 @@ public class TimeseriesQueryEngine
{
Aggregator[] aggregators = QueryRunnerHelper.makeAggregators(cursor, aggregatorSpecs);
try {
final int aggSize = aggregators.length;
final int aggExtra = aggSize % AGG_UNROLL_COUNT;
while (!cursor.isDone()) {
switch(aggExtra) {
case 7: aggregators[6].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();
for(Aggregator aggregator : aggregators) {
aggregator.aggregate();
}
cursor.advance();
}