BlobVec::push is linear #10797
Labels
A-ECS
Entities, components, systems, and events
C-Bug
An unexpected or incorrect behavior
C-Performance
A change motivated by improving speed, memory usage or compile times
Second test finishes in a second.
First test never finishes, and shows it gets slower with each iteration.
It is not noticable in typical application because:
reserve_exact
beforepush
(which is howBlobVec
is used) makes effect less visible (yet keeping insertion kind of quadratic)BlobVec
realloc
often reallocates in place or reallocates to double size, makingpush
effectively constant even with unnecessary call torealloc
. But on larger allocations malloc no longer doubles the size makingpush
very expensive.The text was updated successfully, but these errors were encountered: