| 25 | using namespace impala; |
| 26 | |
| 27 | void TopNNode::InsertBatchUnpartitioned(RuntimeState* state, RowBatch* batch) { |
| 28 | DCHECK(!is_partitioned()); |
| 29 | // TODO: after inlining the comparator calls with codegen - IMPALA-4065 - we could |
| 30 | // probably squeeze more performance out of this loop by ensure that as many loads |
| 31 | // are hoisted out of the loop as possible (either via code changes or __restrict__) |
| 32 | // annotations. |
| 33 | FOREACH_ROW(batch, 0, iter) { |
| 34 | int num_to_reclaim = heap_->InsertTupleRow(this, iter.Get()); |
| 35 | // Using a branch here instead of adding the value directly improves |
| 36 | // top-n performance by a couple of %. |
| 37 | if (num_to_reclaim != 0) rows_to_reclaim_ += num_to_reclaim; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | int TopNNode::Heap::InsertTupleRow(TopNNode* node, TupleRow* input_row) { |
| 42 | const TupleDescriptor& tuple_desc = *node->output_tuple_desc_; |
nothing calls this directly
no test coverage detected