Repository navigation
[diskann-inmem] Remove allocation during prune - #1523
Open
Mark Hildebrand (hildebrandmw) wants to merge 1 commit into
Open
Mark Hildebrand (hildebrandmw) wants to merge 1 commit into
Mark Hildebrand (hildebrandmw) wants to merge 1 commit into
Conversation
Mark Hildebrand (hildebrandmw)
force-pushed
the
mhildebr/inmem-perf
branch
from
October 29, 2026 15:02
231916d to
a8067ec
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Documentation links to removed methods remain unresolved and fail the docs job under -D rustdoc::all.
1 open issue
What changed in this PR
Simplifies in-memory graph pruning by replacing buffered prune keys with borrowed slices, removing the hash-table and pointer-buffer allocations.
Changes:
- Updates prune accessors and tests to retrieve and compare slices directly.
- Moves vector-access counting to retrieval and refreshes integration baselines.
- Centralizes the
erased-serdedependency in the workspace.
| File | Description |
|---|---|
diskann-inmem/src/store/intrusive.rs |
Removes the unused byte-length helper. |
diskann-inmem/src/repr/test/mod.rs |
Tests slice retrieval and distance evaluation. |
diskann-inmem/src/repr/mod.rs |
Replaces prune keys with a slice-based interface. |
diskann-inmem/src/repr/internal/intrusive.rs |
Removes pointer buffering during pruning. |
diskann-inmem/src/repr/full.rs |
Adapts full-precision prune tests. |
diskann-inmem/src/provider.rs |
Removes the key map and uses borrowed element references. |
diskann-inmem/src/counters.rs |
Adds shared-reference vector-access counting. |
diskann-inmem/integration/jsons/integration-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/two-bit-l2-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/two-bit-ip-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/two-bit-cosine-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/one-bit-l2-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/one-bit-ip-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/one-bit-cosine-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/four-bit-l2-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/four-bit-ip-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/spherical/four-bit-cosine-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/scalar/two-bit-cosine-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/scalar/one-bit-l2-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/scalar/four-bit-ip-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/scalar/eight-bit-l2-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/product/l2-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/product/ip-baseline.json |
Refreshes vector-access counts. |
diskann-inmem/integration/jsons/graph/product/cosine-baseline.json |
Refreshes vector-access counts. |
diskann-benchmark-runner/Cargo.toml |
Inherits erased-serde from the workspace. |
Cargo.toml |
Declares the shared erased-serde dependency. |
Review effort: Balanced
Comment on lines
+256
to
257
| /// Implementations may assume that `a` and `b` were produced by a call to | ||
| /// [`Self::prepare`] and are allowed to panic if this is violated. This property may |
Mark Hildebrand (hildebrandmw)
force-pushed
the
mhildebr/inmem-perf
branch
from
October 29, 2026 15:28
a8067ec to
87c1c20
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The
PruneKeydesign forrepr::Prunewas based off of theoretically needing to support hybrid prune for PQ. Since it seems like we won't need to support that (or may still be able to by other means), we can simplify back to using slices and avoid allocating the hash table.Increases in
get_vectorcounts are due torobust_prune_list, which now goes through all the way to theStoreinstead of into the hash table. The total number of vector accesses does not necessarily increase: just the number that behave as if going through the store.