You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Allocating a slot currently including a linear searching for empty slot in the slots vector, in the case of frequent allocating and deallocating, this could be a performance issue.
Description:
in InstanceImpl::allocateSlot, a linear search is done before expanding the slots_'s size.
Issue Template
Title: Allocating a slot currently including a linear searching for empty slot in the slots vector, in the case of frequent allocating and deallocating, this could be a performance issue.
Description:
https://github.com/envoyproxy/envoy/blob/master/source/common/thread_local/thread_local_impl.cc
for (uint64_t i = 0; i < slots_.size(); i++) {
if (slots_[i] == nullptr) {
std::unique_ptr slot(new SlotImpl(*this, i));
slots_[i] = slot.get();
return slot;
}
}
We can maintain a free list to return existing free slot in O(1).
The text was updated successfully, but these errors were encountered: