Skip to content

Reuse HTTP request buffers for native ingest - #6869

Open
fmassot wants to merge 2 commits into
quickwit-oss:mainfrom
fmassot:perf/searchbench-ingest
Open

fmassot wants to merge 2 commits into
quickwit-oss:mainfrom
fmassot:perf/searchbench-ingest

Conversation

@fmassot

@fmassot fmassot commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reuse the NDJSON HTTP body as DocBatchV2.doc_buffer instead of copying document payloads. Also adds a preallocated batch builder and benchmark; shard scaling defaults remain unchanged.

Validation

  • 15 REST/ingest API tests and 1 batch-builder test passed.
  • M3 Max, CLI-matched jemalloc: body-to-batch construction 3.281 → 2.532 ms (~23% less time).
  • Twelve 10M-document HTTP trials verified exact counts. No reproducible publication-time or total-CPU improvement established; acceptance timings varied by configuration.

Before marking ready

  • Fix the regression for form-feed-only blank lines.
  • Resolve the changed lifetime of Body/load-shield guards across the ingest await.

@fmassot
fmassot marked this pull request as ready for review October 4, 2026 22:00
@fmassot
fmassot requested a review from a team as a code owner October 4, 2026 22:00
.filter(|line| !is_empty_or_blank_line(line))
}

fn build_doc_batch_v2_from_ndjson_body(doc_buffer: Bytes) -> Option<DocBatchV2> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn build_doc_batch_v2_from_ndjson_body(doc_buffer: Bytes) -> Option<DocBatchV2> {
fn build_doc_batch_v2_from_ndjson_body(ndjson_body: Bytes) -> Option<DocBatchV2> {

.filter(|line| !is_empty_or_blank_line(line))
}

fn build_doc_batch_v2_from_ndjson_body(doc_buffer: Bytes) -> Option<DocBatchV2> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can abstract away the splitting and parsing part so we can reused in Pomsky for other handlers?

This branch has not been deployed

No deployments
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.

2 participants