Skip to content

[PERF] increase delta conversion speed by batching #4551

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/benchmark/src/datasets/gist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl RecordDataset for GistDataset {
async fn init() -> Result<Self> {
// TODO(Sanket): Download file if it doesn't exist.
// move file from downloads to cached path.
let current_path = "/Users/sanketkedia/Downloads/siftsmall/siftsmall_base.fvecs";
let current_path = "/Users/hammad/Downloads/siftsmall/siftsmall_base.fvecs";
let base_file_path = get_or_populate_cached_dataset_file(
"gist",
"siftsmall_base.fvecs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,12 @@ impl ArrowWriteableValue for &SpannPostingList<'_> {
inner_version_ref.append_value(doc_version);
}
let inner_embeddings_ref = builder.doc_embeddings_builder.values();
let mut f32_count = 0;
for embedding in doc_embeddings.into_iter() {
inner_embeddings_ref.values().append_value(embedding);
f32_count += 1;
if f32_count == embedding_dim {
inner_embeddings_ref.append(true);
f32_count = 0;
}
for chunk in doc_embeddings.chunks(embedding_dim) {
let validity = vec![true; chunk.len()];
inner_embeddings_ref
.values()
.append_values(chunk, &validity);
inner_embeddings_ref.append(true);
}
builder.doc_offset_ids_builder.append(true);
builder.doc_versions_builder.append(true);
Expand Down
16 changes: 8 additions & 8 deletions rust/worker/benches/spann.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ fn bench_spann_compaction(c: &mut Criterion) {
"Added 9000 records to spann segment in {:?} ms",
start_time.elapsed().as_millis()
);
println!("Getting recall on 1000 records");
calculate_recall(
&runtime,
reader,
&records[9000..10000],
&records[0..9000],
deleted_set,
);
// println!("Getting recall on 1000 records");
// calculate_recall(
// &runtime,
// reader,
// &records[9000..10000],
// &records[0..9000],
// deleted_set,
// );
})
},
);
Expand Down
Loading