Skip to content

Conversation

timvisee
Copy link
Member

@timvisee timvisee commented Mar 28, 2025

Tracked in: #6157

An improvement to how we flush versions in the new mutable ID tracker.

With this PR we now check the required size for the versions file. If it isn't large enough to write new versions, we immediately grow it to allocate all required space with one syscall.

Previously, we just wrote new versions to the end of the file directly to automatically grow it. While that is fine, it can cause a lot of file re-allocations to progressively grow it in steps when writing new versions.

This now prevents that, and optimizes for that scenario.

In numbers, if we insert 10k new points, this reduces reallocating the file from 10 times to just once.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Copilot

This comment was marked as resolved.

@timvisee timvisee force-pushed the mutable-id-tracker-version-grow-file branch from 7280d83 to 7e99c00 Compare March 28, 2025 11:36
@qdrant qdrant deleted a comment from coderabbitai bot Mar 28, 2025

This comment has been minimized.

@timvisee timvisee merged commit f23a992 into dev Mar 28, 2025
17 checks passed
@timvisee timvisee deleted the mutable-id-tracker-version-grow-file branch March 28, 2025 15:21
timvisee added a commit that referenced this pull request Mar 31, 2025
…6267)

* In mutable ID tracker, grow versions file in one shot

* Fix typos
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