Repository navigation
perf(analytics): read deals, tuner lists and the calendar faster at large report volumes - #1007
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
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).