Skip to content

perf(analytics): read deals, tuner lists and the calendar faster at large report volumes - #1007

Merged
kirillDevPro merged 1 commit into
mainfrom
perf/analytics-read-path
Oct 16, 2026
Merged

kirillDevPro merged 1 commit into
mainfrom
perf/analytics-read-path

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

What & why

On a large report replica (~13.7k trades, ~600 strategies) every Analytics read was dominated by per-row quote/valuation expressions and a duplicated quote preflight; indexes were not the cause (all plans already SEARCH).

  • One shared quote preflight per deal read; quote and coverage inputs normalized once per row.
  • A normalized strategy-group stage.
  • The Profit Monitor flattens its quote preflight too.
  • An ignored real-data bench (MOON_ANALYTICS_BENCH_DIR) times every surface.

Warm timings before -> after on that replica: all-cores tuning list 2.4-3.5 s -> 1.4-1.9 s, deal read 3.2 s -> 1.9 s, By time 3.1 s -> 1.2 s, By coin 2.6 s -> 1.5 s, yearly Summary 1.2 s -> 1.0 s, yearly Calendar 2.5 s -> 1.9 s. Results are identical: parity tests compare every rewritten query against the old one on synthetic data.

How to verify

cargo test -p moon-core analytics (parity tests).

…arge report volumes

Per-row quote and valuation expressions and a duplicated quote preflight
dominated every Analytics read; indexes were not the cause. One shared
preflight per deal read and inputs normalized once per row cut the
all-cores tuning list, deal reads, By time, By coin, Summary and the
calendar by roughly 20-60% on a large replica, with parity tests proving
identical results. An ignored real-data bench times every surface.
@kirillDevPro
kirillDevPro merged commit 4a5ba73 into main Oct 16, 2026
10 checks passed
@kirillDevPro
kirillDevPro deleted the perf/analytics-read-path branch October 16, 2026 15:05
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