-
Notifications
You must be signed in to change notification settings - Fork 35
feat: pinning index in memory when building, second try #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Let's try it on 100M dataset and see how flamegraph goes |
2c4t, on laion-100m:
next steps:
cc @VoVAllen |
Signed-off-by: usamoi <usamoi@outlook.com>
Why do we need to merge two segments together? The optimization result is pretty close to the flamegraph result. |
And what is 2c4t? |
4 vcpu
not necessary; helpful to make it optional |
bc95918
to
dd76752
Compare
Signed-off-by: usamoi <usamoi@outlook.com>
i4i.xlarge, laion-100m:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a "pinning index in memory" feature by introducing a new cache function and updating related build and index option types. Key changes include:
- Adding a new cache function in crates/algorithm/src/cache.rs that builds an index trace.
- Defining new indexing and build options in src/index/types.rs and refactoring related options in crates/algorithm/src/types.rs.
- Adding a clone_into_boxed method in src/index/storage.rs to safely duplicate PostgresPage data using unsafe pointer copying.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
crates/algorithm/src/cache.rs | New cache function implementation that reads index data and builds a trace. |
src/index/types.rs | New type definitions for internal and external build options to support the pinned index feature. |
src/index/storage.rs | Adds a Debug derive and a clone_into_boxed method for PostgresPage to facilitate boxed cloning. |
crates/algorithm/src/lib.rs | Integrates the new cache module and updates module exports. |
crates/algorithm/src/types.rs | Refactors index options by removing build option types and using a simplified VchordrqIndexOptions struct. |
crates/algorithm/src/build.rs | Updates the build function parameter type to use the new VchordrqIndexOptions. |
Comments suppressed due to low confidence (1)
src/index/storage.rs:46
- Ensure that the unsafe pointer copy in clone_into_boxed is safe for all fields of PostgresPage, particularly if the structure evolves to include non-POD types.
pub fn clone_into_boxed(&self) -> Box<Self> {
issue: #117
first try: #150