Skip to content

perf(file): overlap and coalesce reads during concatenation - #10301

Merged
Xuanwo merged 2 commits into
mainfrom
codex/fe-output-tail
Oct 26, 2026
Merged

Xuanwo merged 2 commits into
mainfrom
codex/fe-output-tail

Conversation

@BubbleCal

@BubbleCal BubbleCal commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Concatenating many staged data-file parts serializes each part's open/validation and then reads payloads one column at a time. For small parts containing vector output and auxiliary columns, these dependent object-store requests dominate concatenation.

This change opens up to min(io_parallelism, 8) parts concurrently while preserving caller order and all existing validation, including #10315's single-GET validation for small parts and HEAD validation for larger parts. For modern files that fit within the existing read-batch budget, it submits payload ranges across columns together, sorted by physical offset, and restores their logical order before copying. Larger files retain streaming reads. There are no file-format or public API changes.

The metadata-hint work in #9169 addresses a different source of read dependencies; this change does not require it.

Performance

Current-head performance has not been remeasured after merging main, including #10315's small-part single-GET validation. The earlier measurements below apply only to the stated historical commits and are not a performance claim for the merged head.

Historical benchmark before merging main

Measured Dataset::concat_data_file_parts only, from baseline c633e438c291dbf1781657a37ad489098438af21 to the earlier candidate 276d0ff57c792ac633c910928efa8d3ed97d8d96. Values are medians of three paired rounds; lower latency is better.

Scenario / metric Baseline Measured candidate (276d0ff) Historical benefit
140 parts / concat latency 54.12 s 32.37 s 1.67x speedup
640 parts / concat latency 204.11 s 40.72 s 5.01x speedup
20 large parts / concat latency 12.15 s 11.24 s 1.08x speedup

The same AWS m7i.8xlarge host (32 vCPUs, 128 GiB RAM), four-CPU process affinity, and same-region S3 in us-east-1 were used for both builds, with Rust 1.98.1 and the repository's release-no-lto profile for this I/O-bound workload. Input was frozen output containing 1,000,000 rows, a 384-dimensional Float32 vector, and five auxiliary columns, written as Lance 2.2. Twenty 50,000-row splits were subdivided into parts of at most 8,192, 1,563, or 50,000 rows. These are controlled part layouts, not a reconstruction of adaptive Function Engine output partitioning.

Each run used a fresh fixture and process, with alternating baseline/PR order and rotating scenarios; no other builds ran during measurement. Full Arrow equality across all rows and all six columns was checked after concatenation, outside the timer. S3 cache state was not controlled. Observed latency ranges were 48.99–54.30 s / 30.19–33.81 s for 140 parts, 202.13–211.54 s / 40.62–56.00 s for 640 parts, and 12.00–12.28 s / 10.53–11.61 s for 20 parts (baseline / PR).

Network allowance counters increased in every 140-part and 20-part observation window, so those results describe this host's network budget. All six 640-part windows had zero allowance-exceeded increments. Counter windows enclosed concatenation and excluded bulk result validation; they were not exact phase boundaries. These results do not measure end-to-end Function Engine refresh, upload, or checkpoint performance.

Object-store read/HEAD calls fell from 840 to 420 for 140 parts and from 3,840 to 1,920 for 640 parts; the 20-part fallback remained at 200 calls. Output sizes and write-call counts were unchanged. Counts are at the object-store layer, not retry-inclusive HTTP requests.

Validation after merging main

Validated merge commit 25120495af468dad17496d881d087704e0ea45ed, including main 71a1b76581c340cd29fc6d837b36efead2afa23b.

  • 27 data-file-part tests, 22 concat tests, and 19 object-reader tests passed on the combined tree.
  • Both small-part and large-part concurrency tests also passed with LANCE_IO_THREADS=1. The small-part case requires zero HEAD requests and exactly one GET per part; both cases check bounded fanout and caller order.
  • Formatting and full workspace Clippy (--all --tests --benches -- -D warnings) passed.
  • The original full-value benchmark results above remain historical; performance has not been remeasured for the merged head.
Validation commands (macOS ARM64, Rust 1.98.1)
cargo fmt --all -- --check
cargo test --locked -p lance --features tokio/test-util --lib dataset::tests::data_file_part
LANCE_IO_THREADS=1 cargo test --locked -p lance --features tokio/test-util --lib opens_parts_concurrently_with_bounded_fanout_and_caller_order
cargo test --locked -p lance-file --features lance-io/aws,lance-io/test-util,tokio/test-util --lib concat::tests
cargo test --locked -p lance-io --features test-util,tokio/test-util --lib object_reader::tests
cargo clippy --locked --all --tests --benches -- -D warnings

Open independent parts with bounded concurrency and preserve caller order.
Read small inputs across columns in one bounded scheduler request, sorting
physical ranges and restoring logical buffer order before copying.

Keep large-input streaming and existing identity, size, row and Blob checks.
Cover interleaved pages, NULL buffers, invalid parts and bounded admission.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer performance labels Oct 24, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 24, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 26, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Gate recommendation: approve.

No merge-blocking issues found. All 49 focused concat and data-file-part tests passed locally on this head, covering value preservation, reduced payload reads, bounded small- and large-part opens, caller order, and rejection before output creation. Both open-path cases also passed with LANCE_IO_THREADS=1.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 26, 2026
@Xuanwo
Xuanwo merged commit 51cf89d into main Oct 26, 2026
43 checks passed
@Xuanwo
Xuanwo deleted the codex/fe-output-tail branch October 26, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer K-approved Latest Gatekeeper recommendation permits acceptance. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants