Skip to content

Conversation

@Manas103
Copy link

@Manas103 Manas103 commented Jan 21, 2026

Rationale for this change

Profiling BM_Tpch_Q1_ExecOnly in Acero shows a hotspot in BasicDecimal128::Abs(), and the existing TPC‑H Q1 benchmark mixes data generation with execution, making it hard to isolate execution costs. This change introduces an exec‑only Q1 benchmark for cleaner profiling and removes an avoidable temporary in Abs() to reduce overhead in decimal‑heavy execution. It also adjusts TDigest test tolerances on MSVC to align with existing libc++ precision behavior.

What changes are included in the PR?

  • Add BM_Tpch_Q1_ExecOnly that pre‑generates the lineitem table and benchmarks only plan execution
  • Refactor Q1 setup to build an exec plan from a pre‑generated table source
  • Optimize BasicDecimal128::Abs() to use IsNegative() directly (avoids temporary + operator<)
  • Relax TDigest test tolerance on MSVC to match libc++ behavior

Are these changes tested?

Yes. I ran the C++ unit test subset labeled unittest using CTest with 4-way parallelism and failure output enabled:

  • ctest -j4 -L unittest --output-on-failure
    All 75 tests in that label passed.

Are there any user-facing changes?

No.

Github Issue: 48931

@Manas103 Manas103 requested a review from westonpace as a code owner January 21, 2026 20:47
@github-actions
Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@Manas103 Manas103 marked this pull request as draft January 21, 2026 20:49
@Manas103 Manas103 changed the title Optimize Decimal128 abs; add exec-only TPC-H Q1 benchmark GH-48931: [C++] Optimize Decimal128 abs; add exec-only TPC-H Q1 benchmark Jan 21, 2026
@github-actions
Copy link

⚠️ GitHub issue #48931 has been automatically assigned in GitHub to PR creator.

@Manas103 Manas103 marked this pull request as ready for review January 21, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant