From 15c195fb0216b9f90cfabfd084f36b03651539e0 Mon Sep 17 00:00:00 2001 From: Kaijie Chen Date: Tue, 26 Nov 2024 23:38:50 +0800 Subject: [PATCH] [cleanup](load) remove bvar "g_memtable_input_block_allocated_size" (#44304) ### What problem does this PR solve? Bvar "g_memtable_input_block_allocated_size" is no longer needed after #40912. Calling `MutableBlock::allocated_bytes()` in `Memtable::insert()` has some performance penalties. So we should remove it. --- be/src/olap/memtable.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp index a70486e39b3a4b..69c886d76ef596 100644 --- a/be/src/olap/memtable.cpp +++ b/be/src/olap/memtable.cpp @@ -44,7 +44,6 @@ namespace doris { bvar::Adder g_memtable_cnt("memtable_cnt"); -bvar::Adder g_memtable_input_block_allocated_size("memtable_input_block_allocated_size"); using namespace ErrorCode; @@ -146,7 +145,6 @@ MemTable::~MemTable() { << _mem_tracker->consumption(); } } - g_memtable_input_block_allocated_size << -_input_mutable_block.allocated_bytes(); g_memtable_cnt << -1; if (_keys_type != KeysType::DUP_KEYS) { for (auto it = _row_in_blocks.begin(); it != _row_in_blocks.end(); it++) { @@ -208,11 +206,8 @@ Status MemTable::insert(const vectorized::Block* input_block, auto num_rows = row_idxs.size(); size_t cursor_in_mutableblock = _input_mutable_block.rows(); - auto block_size0 = _input_mutable_block.allocated_bytes(); RETURN_IF_ERROR(_input_mutable_block.add_rows(input_block, row_idxs.data(), row_idxs.data() + num_rows, &_column_offset)); - auto block_size1 = _input_mutable_block.allocated_bytes(); - g_memtable_input_block_allocated_size << block_size1 - block_size0; for (int i = 0; i < num_rows; i++) { _row_in_blocks.emplace_back(new RowInBlock {cursor_in_mutableblock + i}); } @@ -522,7 +517,6 @@ Status MemTable::_to_block(std::unique_ptr* res) { } RETURN_IF_ERROR(_sort_by_cluster_keys()); } - g_memtable_input_block_allocated_size << -_input_mutable_block.allocated_bytes(); _input_mutable_block.clear(); // After to block, all data in arena is saved in the block _arena.reset();