Skip to content

Conversation

@alonre24
Copy link
Collaborator

@alonre24 alonre24 commented May 2, 2023

Describe the changes in the pull request

Cherry-pick from #362

id_to_label_mapping in brute force index is a std::vector, and whenever we resize it, its capacity is determined according to this container's policy. Then, when we add a block and call for resize, the capacity is doubled (rather than increased by block size). The fix is calling shring_to_fit() which deallocates unnecessary memory from the container (so its capacity matches its size).

@alonre24 alonre24 requested a review from DvirDukhan May 2, 2023 12:41
@codecov
Copy link

codecov bot commented May 2, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d784136) 95.01% compared to head (da5237e) 95.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##              0.6     #365   +/-   ##
=======================================
  Coverage   95.01%   95.02%           
=======================================
  Files          60       60           
  Lines        3412     3414    +2     
=======================================
+ Hits         3242     3244    +2     
  Misses        170      170           
Impacted Files Coverage Δ
src/VecSim/algorithms/brute_force/brute_force.h 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@alonre24 alonre24 merged commit b0918ea into 0.6 May 3, 2023
@alonre24 alonre24 deleted the cp_shrink_to_fit_bf branch May 3, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants