-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In some cases we create vectors for response eg OpResult<StringVec> dfly::OpInter(const dfly::Transaction* t, dfly::EngineShard* es, bool remove_first)
and push elements into it iterating over a set.
These vectors can end up being multiple 100s of MiB in size (250MiB vectors have been observed).
This ends up in a lot of reallocations over time as the vector grows and potentially moves to new memory pages.
It can be more efficient (to be tested if it actually is) to first determine the result size, allocate vector with that capacity, and then add results to it, or even use a chunked vector similar to deque
but with configurable chunk size, which chains together contiguous blocks of memory and allocates a new one when the existing one is full.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request