Skip to content

Speed up nested custom-curve previews - #324

Merged
zerodrift merged 1 commit into
masterfrom
perf/nested-curve-preparation
Nov 19, 2026
Merged

zerodrift merged 1 commit into
masterfrom
perf/nested-curve-preparation

Conversation

@zerodrift

Copy link
Copy Markdown
Owner

Nested custom-curve previews repeated the same database reads and declaration hashing across sample dates, output points and shared ancestors. This change collects the required historical windows in one authorized read when they fit the existing reader bounds, reuses validated native contract mappings and derives each immutable declaration’s identity once. Each sample still applies its own correction and expiry rules. Exact close and publication pins keep their existing authorization path.

Measured performance

Warm median HTTP times on loopback for 76 delivery periods in a synthetic 3,031-contract market. Each build had one warm-up and three timed requests per workload.

Preview Before After
Direct curve, context date 230 ms 174 ms
Base plus basis, context date 433 ms 175 ms
Direct curve, 30-date average 1,332 ms 333 ms
Base plus basis, 30-date average 7,560 ms 459 ms
Four levels of published recipes 1,405 ms 299 ms
Two published 30-date averages combined 2,512 ms 523 ms

The 12-contract, 20-date regression fixture dropped from 20 historical observation queries to one per preview. All six scaled workloads returned matching displayed rows, dated contract IDs and exact input prices. The timings cover the authenticated API request through JSON decoding. Browser rendering and production latency were outside the measurement. Workload, timing ranges and allocation results.

Configuration and verification

Version 2 process limits require an explicit previewRecipeSampleReferences within the versioned engine allowance. Existing version 1 configurations and retained valuation and risk replay keep their existing allowance.

  • All 785 managed core checks passed. A deterministic comparison matched 39 full plan hashes across recipe, contract-observation and date-lookup fixtures.
  • Disposable PostgreSQL suites passed for custom-curve previews, corrections, publication authority, connected portfolios and retained worker replay.
  • Regression checks cover the configured budget boundary, oversized or empty window requests, authorization and cancellation.

Batch historical observation windows on the authorized preview connection and reuse the validated native mapping index. Derive immutable recipe identities once and validate their contents in each compilation context.

Select the interactive sample-reference budget through versioned process settings and retain the existing allowance for valuation replay.

Signed-off-by: zerodrift <zerodrift@users.noreply.github.com>
@zerodrift
zerodrift enabled auto-merge November 19, 2026 03:35
@zerodrift
zerodrift merged commit 440a454 into master Nov 19, 2026
24 checks passed
@zerodrift
zerodrift deleted the perf/nested-curve-preparation branch November 19, 2026 04:11
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