MiniCTRMSearch

MiniCTRM - Build Tutorial 631: Performance: compress market data, keep a save fast

→ to begin · N for the speaker notes

On a phone: Next or a swipe left to begin, Notes for the words.

What you'll learn

A timing log with a Timings screen and a written baseline; a query budget test on the save, the preview and the blotter page; closes and valuation runs stored compressed - closes about twenty times smaller, runs some fifty - read through their one stores with extract tables for SQL that application code never reads; indexes added from real query plans, each with a test; and a front end split by screen with big grids fetched a page at a time - every number measured before and after.

  • Measure first – A timing log with a query count on every operation, a Timings screen, and a baseline written down before anything changes.
  • A query budget – The N+1 problem from zero, and a test that holds the save, the preview and the blotter page to a fixed number of queries.
  • Compressed closes and runs – A packed strip - closes about twenty times smaller, runs some fifty - read through the one store, with extract tables for SQL that application code never reads.
  • Indexes from real queries – What an index is and what it costs, the query plan, and indexes added only where measuring says so.
  • Screens that load lazily – A bundle split by screen, the Launcher's first paint, and big grids fetched a page at a time.
  • Ship it – /ship, with the budgets, the round trips and the query plans among the tests.
  • How MiniCTRM did it – Close Storage and Database Size, live, and the one-door rule that made compression a change to one class.

Before you start

The lessons this one builds on: 542 Market data: forward curves, FX, settlement prices and closes, 601 Valuation and reports: mark-to-market, valuation runs, position, day-over-day change, 621 End of day: close the market, run the valuation, automate the night, 622 Running jobs in parallel: the end of day in ten minutes, not twenty.

Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.

Welcome

Two seconds and an hour

1 / 15
Two seconds and an hour
Measure first

Measured, never guessed

2 / 15
Measured, never guessed
Measure first

A timing log and a baseline

3 / 15
A timing log and a baseline
A query budget

One query, not one per row

4 / 15
One query, not one per row
A query budget

The budget tests, and the save made to pass them

5 / 15
The budget tests, and the save made to pass them
Compressed closes and runs

A packed strip: closes twenty times smaller, runs fifty

6 / 15
A packed strip: closes twenty times smaller, runs fifty
Compressed closes and runs

Compressed closes, compressed runs, and the extract tables

7 / 15
Compressed closes, compressed runs, and the extract tables
Indexes from real queries

An index, from zero

8 / 15
An index, from zero
Indexes from real queries

Indexes where the plans ask for them

9 / 15
Indexes where the plans ask for them
Screens that load lazily

A bundle, and a page at a time

10 / 15
A bundle, and a page at a time
Screens that load lazily

Lazy screens and paged grids

11 / 15
Lazy screens and paged grids
Ship it

Ship it

12 / 15
Ship it
How MiniCTRM did it

Close Storage and Valuation Storage

13 / 15
Close Storage and Valuation Storage
How MiniCTRM did it

Database Size, and the blotter's indexes

14 / 15
Database Size, and the blotter's indexes
What you have now

What you have now

15 / 15
What you have now
← → move · N notes · Home / End