-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
@@ -82,45 +82,46 @@ class column final : public irs::column_output { | |||
|
|||
class address_table { | |||
public: | |||
address_table(ManagedTypedAllocator<uint64_t> alloc) : alloc_{alloc} { | |||
offsets_ = alloc_.allocate(kBlockSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we allocate very good aligned blocks, so I think it's better utilize allocator.
Also if allocator decide to use mmap, we will get lazy init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here would be 2 allocations. One for deque itself and this one for internal contents. Better to benchmark this on test load with many columns.
IRS_ASSERT(offset_ > offsets_); | ||
*--offset_ = 0; | ||
IRS_ASSERT(offsets_ < offset_); | ||
--offset_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to set zero to unused data
|
||
void reset() noexcept { | ||
std::memset(offsets_, 0, sizeof offsets_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to set zero to unused data
|
||
private: | ||
uint64_t offsets_[kBlockSize]{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need zero unused data
offset_ = offsets_; | ||
} | ||
|
||
~address_table() { alloc_.deallocate(offsets_, kBlockSize); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also deque with columns works better now:
blocks in deque could handle few columns and we don't store this memory forever.
only while write segment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Try less memory usage * fixes * Update columnstore2.cpp * Add benchmark * Add benchmark * Add benchmark
* Try less memory usage * fixes * Update columnstore2.cpp * Add benchmark * Add benchmark * Add benchmark
* Try less memory usage (#516) * Try less memory usage * fixes * Update columnstore2.cpp * Add benchmark * Add benchmark * Add benchmark * Make reserve for wildcard nfa construction (#536) * Fix burst trie UB (#537) * Fix UB * Hotfix for directory resource managment * Try less memory usage (#516) * Try less memory usage * fixes * Update columnstore2.cpp * Add benchmark * Add benchmark * Add benchmark * wip (#543) * wip * wip * wip
* Try less memory usage (#516) * Try less memory usage * fixes * Update columnstore2.cpp * Add benchmark * Add benchmark * Add benchmark * Make reserve for wildcard nfa construction (#536) * Fix burst trie UB (#537) * Fix UB * Hotfix for directory resource managment * Try less memory usage (#516) * Try less memory usage * fixes * Update columnstore2.cpp * Add benchmark * Add benchmark * Add benchmark * wip (#543) * wip * wip * wip
0.4 vs 0.5 on my machine with old memset.
And 0.1 without unnecessary memset