mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-04 10:35:46 +01: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 {
|
for bytes in slices {
|
||||||
if bytes.len() <= THRESHOLD * size_of::<u32>() {
|
if bytes.len() <= THRESHOLD * size_of::<u32>() {
|
||||||
debug_assert!(bytes.len() % size_of::<u32>() == 0);
|
debug_assert!(bytes.len() % size_of::<u32>() == 0);
|
||||||
|
vec.reserve(bytes.len() / size_of::<u32>());
|
||||||
|
|
||||||
for bytes in bytes.chunks_exact(size_of::<u32>()) {
|
for bytes in bytes.chunks_exact(size_of::<u32>()) {
|
||||||
// unwrap can't happens since we ensured that everything
|
// unwrap can't happens since we ensured that everything
|
||||||
|
Loading…
Reference in New Issue
Block a user