mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 19:45:05 +08:00
2 additional precent won by reserving the memory before pushing in the vec
This commit is contained in:
parent
01b1effec0
commit
4696b8199f
@ -71,6 +71,7 @@ impl CboRoaringBitmapCodec {
|
||||
for bytes in slices {
|
||||
if bytes.len() <= THRESHOLD * size_of::<u32>() {
|
||||
debug_assert!(bytes.len() % size_of::<u32>() == 0);
|
||||
vec.reserve(bytes.len() / size_of::<u32>());
|
||||
|
||||
for bytes in bytes.chunks_exact(size_of::<u32>()) {
|
||||
// unwrap can't happens since we ensured that everything
|
||||
|
Loading…
Reference in New Issue
Block a user