Skip to content

chore(bench): curate benchmarks to ~30 representative indicators#63

Open
kingchenc wants to merge 1 commit into
mainfrom
chore/bench-curation
Open

chore(bench): curate benchmarks to ~30 representative indicators#63
kingchenc wants to merge 1 commit into
mainfrom
chore/bench-curation

Conversation

@kingchenc
Copy link
Copy Markdown
Owner

Summary

Replaces the exhaustive 114-indicator benchmark list with a curated selection: the cheapest baseline and the most expensive representative from each of the sixteen families, totalling ~33 entries across scalar / candle / multi-output APIs.

Why

The exhaustive bench list ran every indicator at three workload sizes (1k / 10k / 50k candles), pushing `cargo bench -p wickra` past ten minutes for diminishing signal — most family members are linear scalings of the same hot loop, so a regression shows up identically in the cheapest member.

The curated list keeps the regression-detection value while cutting bench runtime by ~3-4×. If a contributor needs to profile a specific indicator that is not in the curated set, they can add it temporarily and run `cargo bench -- ` to target just that bench — does not need to be committed.

Curation by family

Family Kept
Moving Averages Sma, Ema, Frama, Jma, T3
Momentum Oscillators Rsi, Cci, ConnorsRsi
Trend & Directional Adx, WaveTrend
Price Oscillators Macd, Ppo, Stc
Volatility & Bands Atr, Bollinger, Parkinson, YangZhang
Bands & Channels TtmSqueeze, VwapStdDevBands
Trailing Stops Psar, SuperTrend
Volume Obv, Vwap, RollingVwap
Price Statistics LinearRegression, HurstExponent, Autocorrelation
Ehlers / Cycle Mama, HilbertDominantCycle, EmpiricalModeDecomposition
Pivots ClassicPivots
DeMark TdSequential
Ichimoku Ichimoku
Candlestick Patterns Engulfing
Market Profile ValueArea
Risk / Performance SharpeRatio, MaxDrawdown, CalmarRatio, ValueAtRisk

Bug fixes carried in passing

  • `Cci` is `Indicator<Input = Candle>`, not f64; the old call had it on `bench_scalar` which would have failed to compile if it had been added recently. Corrected to `bench_candle_input`.
  • `Psar::new` takes `(af_start, af_step, af_max)` — the old call supplied only two arguments.
  • `TdSequential` uses `::classic` for the textbook (4, 9, 2, 13) parameters.

Diff stats

`1 file changed, 120 insertions(+), 304 deletions(-)` — net 184 LOC removed.

Verification

  • `cargo bench --manifest-path crates/wickra/Cargo.toml --no-run` compiles clean.
  • No bench function bodies changed; helper signatures unchanged.

Conflict status

Independent of the three open PRs (#59, #60, #61). No shared files.

Previously every push of `cargo bench -p wickra` ran 114 indicators at
three workload sizes each (1k / 10k / 50k candles), which inflated bench
runtime past ten minutes for diminishing signal — most family members
are linear scalings of the same hot loop, so a regression in any one of
them shows up identically in the cheapest member.

This commit replaces the exhaustive list with a curated selection: the
cheapest baseline and the most expensive representative from each of
the sixteen families, totalling ~33 indicators across scalar, candle,
and multi-output APIs.

If you need to profile a specific indicator that is not in the curated
set, add it temporarily and run `cargo bench -- <name>` to target just
that bench; it does not need to be committed.

Fixed in passing:
- `Cci` is `Indicator<Input = Candle>`, not f64; corrected the bench
  selector to `bench_candle_input`.
- `Psar::new` takes (af_start, af_step, af_max) — supplied all three.
- `TdSequential` uses `::classic` for the textbook (4, 9, 2, 13)
  parameters; the old call was missing arguments.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant