Skip to content

perf: decode Variant object offsets in bulk - #1393

Open
XiaoHongbo-Hope wants to merge 2 commits into
apache:mainfrom
XiaoHongbo-Hope:codex/variant-bulk-offsets
Open

XiaoHongbo-Hope wants to merge 2 commits into
apache:mainfrom
XiaoHongbo-Hope:codex/variant-bulk-offsets

Conversation

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

What

Decode a validated Variant object offset table in bulk, dispatching once on its 1–4 byte width instead of calling the checked, byte-at-a-time decoder for every offset.

The existing root-size, offset-order, field-layout and selected-value validation remains unchanged. No format, API, configuration or dependency changes.

Validation

  • Tests cover all four widths, empty objects, numeric and cast extraction, repeated projection, non-monotonic offsets, truncation, duplicate offsets, oversized offsets and trailing payload bytes.
  • cargo fmt --all and git diff --check.
  • cargo test --release -p paimon --lib variant:: is running; results will be updated before marking ready.

Performance

An earlier-base microbenchmark (fb5e8f7, Arrow 58) exercised the production variant_get_numeric_fields entry point on resident Arrow input: 146 rows, 200 projected fields, 5,569 fields per Variant. Three independent processes with alternating baseline/candidate rounds measured median process CPU of 12.21–12.40 ms versus 7.99–8.06 ms (34–35% less CPU). Complete Arrow outputs matched.

This measures numeric extraction only, excluding Parquet decoding, I/O and planning. It is not an end-to-end throughput claim or a performance measurement of the latest main dependency set. No customer fixture is included.

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review November 12, 2026 14:14

@QuakeWang QuakeWang left a comment

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.

LGTM

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