Skip to content

GH-49315: [C++] Optimize Decimal128 abs; add exec-only TPC-H Q1 benchmark#49315

Open
Manas103 wants to merge 1 commit intoapache:mainfrom
Manas103:perf/decimal-abs-tpch-q1
Open

GH-49315: [C++] Optimize Decimal128 abs; add exec-only TPC-H Q1 benchmark#49315
Manas103 wants to merge 1 commit intoapache:mainfrom
Manas103:perf/decimal-abs-tpch-q1

Conversation

@Manas103
Copy link

@Manas103 Manas103 commented Feb 18, 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 February 18, 2026 02:41
@Manas103 Manas103 changed the title GH-48931: [C++] Optimize Decimal128 abs; add exec-only TPC-H Q1 benchmark GH-49315: [C++] Optimize Decimal128 abs; add exec-only TPC-H Q1 benchmark Feb 18, 2026
@github-actions
Copy link

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

@rok
Copy link
Member

rok commented Feb 18, 2026

Thanks for opening a PR @Manas103 ! Before we start the review, can you share what you're seeing benchmark result improvements after this change?
Also we don't normally reopen PRs for visibility.

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.

2 participants