This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 7560a78fcbc [cleanup](load) remove bvar
"g_memtable_input_block_allocated_size" (#44304)
7560a78fcbc is described below
commit 7560a78fcbc083d35c9b49981133999b0662ba93
Author: Kaijie Chen <[email protected]>
AuthorDate: Tue Nov 26 23:38:50 2024 +0800
[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 233c59f0910..5db3d89378b 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -43,7 +43,6 @@
namespace doris {
bvar::Adder<int64_t> g_memtable_cnt("memtable_cnt");
-bvar::Adder<int64_t>
g_memtable_input_block_allocated_size("memtable_input_block_allocated_size");
using namespace ErrorCode;
@@ -151,7 +150,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++) {
@@ -222,11 +220,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});
}
@@ -631,7 +626,6 @@ Status
MemTable::_to_block(std::unique_ptr<vectorized::Block>* 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();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]