Add exchange in MemPool to reduce alloc/free operation (#1732)

Reuse allocated chunks when storage read operation.
This commit is contained in:
ZHAO Chun
2019-09-02 19:29:30 +08:00
committed by GitHub
parent 8034d83e20
commit b4f6f755f1
6 changed files with 461 additions and 571 deletions

View File

@ -139,8 +139,11 @@ void VectorizedRowBatch::dump_to_row_block(RowBlock* row_block) {
row_block->_limit = _size;
row_block->_info.row_num = _size;
row_block->_block_status = _block_status;
row_block->mem_pool()->free_all();
row_block->mem_pool()->acquire_data(_mem_pool.get(), false);
// exchange two memory pool to reduce chunk allocate in MemPool,
row_block->mem_pool()->exchange_data(_mem_pool.get());
// Clear to reuse already allocated chunk
_mem_pool->clear();
}
} // namespace doris