Repository Public
1<!-- Author: Simon-Pierre Boucher — contact@spboucher.ai · File: docs/CHART_PERFORMANCE.md -->2# Chart renderer — performance measurement and the Metal decision (2.0.0)34**Decision: Core Graphics (SwiftUI `Canvas`) is kept; Metal is not adopted.** The measurement showed that the 1.0.15renderer missed the 120 Hz budget on long series, but the time was spent in the app's own per-frame work (building6paths with one point per source bar for every indicator, one calendar lookup per visible bar for the time axis), not7in rasterisation. Bounding that work by the window width — which is what a GPU renderer would also have required —8removed the problem: the same 50 000-bar chart with every indicator went from a median of 165 ms of main-thread work per frame to 4.8 ms. What remains above budget is stated below.910## Method1112A DEBUG-only harness in the app (`Features/Charting/ChartBench.swift`, compiled out of Release) runs the real13`ChartCanvas` in a real on-screen window:1415```16VQ_DERIVED=… Scripts/run-dev.sh -- -VQSection charting -VQXChartNoSync 1 -VQXChartBench 10000,20000,50000,100000 \17 -VQXChartBenchOut "$HOME/Library/Containers/ai.spboucher.vquant.debug/Data/tmp/chart-bench.json"18```1920- **Series**: a seeded geometric random walk with intrabar extremes (deterministic), used for the benchmark only and21 never shown as data. 10 000, 20 000, 50 000 and 100 000 bars. The server's own limit is 50 000 bars per request.22- **Scenarios**, each driven by a `CADisplayLink` for 240 consecutive frames after 10 warm-up frames, every frame23 changing the visible window so the whole chart is redrawn: *zoom at full extent* (all bars visible, alternating24 between 100 % and 98 % of the series — the worst case: a full redraw of everything), *pan with 2 000 bars25 visible*, *pan with 200 bars visible* (every candle drawn individually).26- **With and without indicators** (all of SMA 20/50/200, EMA 20, Bollinger, volume, RSI, MACD against none), and27 with **0 or 50 drawings** (all six kinds, spread over the series; drawings did not exist in 1.0.1).28- **Sizes**: 1000 × 640 pt (the plot of a default main window) and 1728 × 1000 pt. The built-in panel of the test29 machine is 1312 × 848 pt at the scaling in use, so the second window extends past the screen edge: its main-thread30 cost is measured in full, but the window server may not composite the hidden part. A true 5K surface is covered by31 the off-screen measure below (2560 × 1440 pt at 2x = 5120 × 2880 px).32- **What is recorded per frame**: `main` = time the main run loop was busy between two display-link ticks (SwiftUI33 update + the Canvas draw closure + the Core Animation commit) — the number that decides whether a frame is missed;34 `closure` = time inside `ChartCanvas.draw` alone; delivered tick interval (a frame is counted *missed* when the35 interval exceeds 1.5 display periods); process CPU time per frame (all threads). Median / p95 / worst, in ms.36- **Off-screen full redraw**: `ImageRenderer` → `CGImage` at 2x, 10 timed renders after 2 warm-ups: the CPU37 rasterisation cost of one complete frame, also the cost of a PNG export.38- **Memory**: `phys_footprint` of the process before loading a series, after loading it and after its scenarios.3940Limits of the method, stated plainly: the build is **Debug (`-Onone`)**, so absolute numbers are pessimistic for a41Release build (not measured: the harness does not exist in Release); GPU time in the render server is not measured42directly, only through missed frames; other engineers' builds and UI tests were running on the same Mac during both43runs, which explains isolated worst-case spikes (single frames of 30–170 ms in otherwise flat series) in both tables;44one run each, no averaging across runs.4546## Machine4748- Apple M5 Max, 48 GB, macOS Version 27.0 (Build 26A5425a)49- Display: 1312×848 pt @2.0x, up to 120 Hz; the display link ran at 120 Hz (budget 8.33 ms)50- Before: `Core Graphics (SwiftUI Canvas), 1.0.1 renderer` (commit e5201a3 + the timing hooks). After: `Core Graphics (SwiftUI Canvas), 2.0 renderer (aligned reduction cached per zoom level)`.5152## Results — main-thread work per frame (ms, median / p95 / worst) and missed frames out of 2405354### 1000 × 640 pt5556| Bars | Scenario | Indicators | 1.0.1 renderer | missed | 2.0 renderer | missed | 2.0 with 50 drawings | missed |57|---:|---|---|---|---:|---|---:|---|---:|58| 10000 | zoom at full extent | none | 6.1 / 6.5 / 7.0 | 0 | 2.0 / 2.9 / 6.7 | 0 | 4.5 / 6.9 / 8.4 | 0 |59| 10000 | pan, 2 000 bars visible | none | 3.0 / 3.2 / 3.5 | 0 | 3.1 / 4.6 / 7.3 | 0 | 4.4 / 7.5 / 9.5 | 0 |60| 10000 | pan, 200 bars visible | none | 2.1 / 2.2 / 2.7 | 0 | 2.4 / 3.7 / 4.7 | 0 | 4.7 / 7.2 / 8.1 | 0 |61| 10000 | zoom at full extent | all | 39.4 / 50.4 / 165.9 | 240 | 5.0 / 6.3 / 7.4 | 0 | 5.5 / 6.1 / 7.3 | 0 |62| 10000 | pan, 2 000 bars visible | all | 12.0 / 13.1 / 28.8 | 109 | 5.1 / 6.1 / 7.7 | 0 | 5.2 / 5.8 / 10.3 | 0 |63| 10000 | pan, 200 bars visible | all | 3.5 / 4.1 / 4.5 | 0 | 3.9 / 5.8 / 8.9 | 0 | 4.7 / 6.5 / 14.0 | 0 |64| 20000 | zoom at full extent | none | 10.6 / 11.2 / 12.5 | 73 | 2.9 / 4.6 / 5.1 | 0 | 4.7 / 6.4 / 7.9 | 0 |65| 20000 | pan, 2 000 bars visible | none | 3.0 / 3.4 / 4.1 | 0 | 2.8 / 4.4 / 5.8 | 0 | 4.8 / 6.8 / 9.3 | 0 |66| 20000 | pan, 200 bars visible | none | 2.0 / 2.5 / 2.9 | 0 | 2.0 / 2.8 / 4.2 | 0 | 4.6 / 7.2 / 8.4 | 0 |67| 20000 | zoom at full extent | all | 74.6 / 99.8 / 116.6 | 240 | 4.9 / 6.7 / 8.6 | 0 | 5.2 / 5.6 / 6.4 | 0 |68| 20000 | pan, 2 000 bars visible | all | 8.9 / 13.0 / 108.7 | 36 | 4.9 / 5.8 / 6.9 | 0 | 4.8 / 5.3 / 7.6 | 0 |69| 20000 | pan, 200 bars visible | all | 4.7 / 6.0 / 7.6 | 0 | 3.8 / 6.2 / 7.6 | 0 | 4.7 / 5.8 / 7.6 | 0 |70| 50000 | zoom at full extent | none | 16.9 / 19.8 / 22.8 | 212 | 2.6 / 3.4 / 3.9 | 0 | 4.9 / 6.3 / 8.1 | 0 |71| 50000 | pan, 2 000 bars visible | none | 3.0 / 3.5 / 8.1 | 0 | 2.3 / 3.0 / 3.8 | 0 | 4.6 / 6.8 / 7.5 | 0 |72| 50000 | pan, 200 bars visible | none | 2.4 / 3.6 / 4.7 | 0 | 1.8 / 2.4 / 6.3 | 0 | 4.1 / 7.5 / 8.4 | 0 |73| 50000 | zoom at full extent | all | 164.7 / 181.5 / 360.9 | 240 | 4.8 / 6.2 / 9.8 | 0 | 6.7 / 7.4 / 8.9 | 0 |74| 50000 | pan, 2 000 bars visible | all | 8.9 / 10.7 / 11.7 | 26 | 3.8 / 6.6 / 8.1 | 0 | 6.1 / 6.7 / 8.2 | 0 |75| 50000 | pan, 200 bars visible | all | 3.4 / 4.3 / 5.3 | 0 | 2.6 / 4.0 / 7.1 | 0 | 5.0 / 5.5 / 5.9 | 0 |76| 100000 | zoom at full extent | none | 29.8 / 34.0 / 99.3 | 240 | 2.6 / 3.0 / 4.9 | 0 | 5.1 / 7.7 / 11.4 | 0 |77| 100000 | pan, 2 000 bars visible | none | 2.8 / 4.2 / 5.0 | 0 | 2.8 / 4.0 / 7.4 | 0 | 4.7 / 5.9 / 7.4 | 0 |78| 100000 | pan, 200 bars visible | none | 1.9 / 3.1 / 4.1 | 0 | 1.8 / 2.5 / 5.5 | 0 | 4.5 / 6.6 / 7.6 | 0 |79| 100000 | zoom at full extent | all | 444.3 / 494.4 / 941.0 | 240 | 4.4 / 6.5 / 15.0 | 1 | 6.4 / 7.5 / 9.2 | 0 |80| 100000 | pan, 2 000 bars visible | all | 12.7 / 13.5 / 14.0 | 133 | 4.8 / 6.2 / 8.2 | 1 | 5.1 / 5.9 / 7.5 | 0 |81| 100000 | pan, 200 bars visible | all | 3.1 / 3.4 / 6.6 | 0 | 3.5 / 5.5 / 7.5 | 0 | 4.5 / 7.1 / 8.4 | 0 |8283### 1728 × 1000 pt8485| Bars | Scenario | Indicators | 1.0.1 renderer | missed | 2.0 renderer | missed | 2.0 with 50 drawings | missed |86|---:|---|---|---|---:|---|---:|---|---:|87| 10000 | zoom at full extent | none | 7.4 / 8.2 / 9.1 | 0 | 4.0 / 5.8 / 8.6 | 0 | 5.1 / 5.9 / 8.2 | 0 |88| 10000 | pan, 2 000 bars visible | none | 3.6 / 5.8 / 54.3 | 2 | 3.5 / 5.2 / 7.6 | 0 | 4.5 / 6.4 / 8.1 | 0 |89| 10000 | pan, 200 bars visible | none | 2.4 / 3.0 / 49.1 | 2 | 3.2 / 4.9 / 7.0 | 0 | 4.2 / 7.7 / 8.6 | 0 |90| 10000 | zoom at full extent | all | 51.7 / 58.2 / 92.8 | 240 | 4.3 / 6.6 / 8.3 | 0 | 6.7 / 7.3 / 8.2 | 0 |91| 10000 | pan, 2 000 bars visible | all | 12.4 / 13.6 / 14.5 | 120 | 4.1 / 7.3 / 9.3 | 0 | 6.0 / 6.7 / 7.9 | 0 |92| 10000 | pan, 200 bars visible | all | 3.6 / 3.9 / 7.2 | 0 | 4.6 / 6.2 / 8.2 | 0 | 4.7 / 5.6 / 6.3 | 0 |93| 20000 | zoom at full extent | none | 7.4 / 7.8 / 35.6 | 1 | 4.3 / 6.0 / 7.8 | 0 | 4.9 / 7.1 / 19.2 | 2 |94| 20000 | pan, 2 000 bars visible | none | 3.2 / 5.5 / 31.1 | 1 | 4.3 / 6.2 / 6.9 | 0 | 4.5 / 6.9 / 10.2 | 0 |95| 20000 | pan, 200 bars visible | none | 3.1 / 4.1 / 5.6 | 0 | 2.6 / 4.9 / 5.3 | 0 | 4.1 / 7.6 / 8.6 | 0 |96| 20000 | zoom at full extent | all | 68.2 / 73.0 / 174.3 | 240 | 4.6 / 5.7 / 7.8 | 0 | 7.0 / 7.6 / 9.8 | 0 |97| 20000 | pan, 2 000 bars visible | all | 8.5 / 9.4 / 10.0 | 10 | 3.9 / 7.2 / 10.4 | 0 | 5.9 / 6.4 / 7.9 | 0 |98| 20000 | pan, 200 bars visible | all | 4.6 / 6.1 / 8.7 | 0 | 4.3 / 6.4 / 7.7 | 0 | 4.7 / 5.6 / 7.0 | 0 |99| 50000 | zoom at full extent | none | 24.1 / 25.6 / 101.1 | 240 | 2.7 / 4.9 / 6.1 | 0 | 5.0 / 6.4 / 9.4 | 0 |100| 50000 | pan, 2 000 bars visible | none | 3.8 / 4.8 / 47.1 | 1 | 3.4 / 4.6 / 6.8 | 0 | 4.7 / 6.9 / 8.5 | 0 |101| 50000 | pan, 200 bars visible | none | 2.4 / 2.9 / 3.4 | 0 | 2.9 / 4.2 / 5.2 | 0 | 4.5 / 6.6 / 7.9 | 0 |102| 50000 | zoom at full extent | all | 230.3 / 249.8 / 515.6 | 240 | 4.7 / 5.1 / 10.9 | 0 | 7.7 / 8.7 / 11.8 | 0 |103| 50000 | pan, 2 000 bars visible | all | 10.3 / 13.7 / 14.7 | 70 | 4.3 / 7.5 / 175.9 | 7 | 6.3 / 7.1 / 7.9 | 0 |104| 50000 | pan, 200 bars visible | all | 3.5 / 5.1 / 8.2 | 0 | 4.1 / 6.4 / 8.1 | 0 | 4.8 / 6.0 / 8.0 | 0 |105| 100000 | zoom at full extent | none | 45.7 / 49.8 / 130.7 | 240 | 2.9 / 5.4 / 7.3 | 0 | 5.5 / 6.3 / 7.4 | 0 |106| 100000 | pan, 2 000 bars visible | none | 3.6 / 4.3 / 68.7 | 2 | 2.9 / 4.0 / 6.0 | 0 | 4.8 / 6.1 / 23.0 | 5 |107| 100000 | pan, 200 bars visible | none | 2.5 / 2.9 / 16.4 | 1 | 2.4 / 3.8 / 5.1 | 0 | 4.2 / 7.2 / 8.1 | 0 |108| 100000 | zoom at full extent | all | 476.1 / 540.9 / 1055.3 | 240 | 4.5 / 6.1 / 15.4 | 1 | 7.5 / 8.2 / 10.7 | 0 |109| 100000 | pan, 2 000 bars visible | all | 12.9 / 14.0 / 142.8 | 124 | 3.6 / 7.2 / 25.6 | 1 | 6.1 / 6.9 / 8.9 | 0 |110| 100000 | pan, 200 bars visible | all | 3.7 / 4.6 / 38.8 | 2 | 4.5 / 5.9 / 7.2 | 0 | 5.4 / 8.5 / 141.5 | 4 |111112## Results — draw closure alone (ms, median / p95), 1000 × 640 pt113114| Bars | Scenario | Indicators | 1.0.1 | 2.0 | 2.0 with 50 drawings |115|---:|---|---|---|---|---|116| 10000 | zoom at full extent | none | 5.4 / 5.8 | 1.3 / 1.9 | 3.8 / 6.2 |117| 10000 | pan, 2 000 bars visible | none | 2.3 / 2.4 | 2.2 / 3.5 | 3.8 / 6.8 |118| 10000 | pan, 200 bars visible | none | 1.3 / 1.4 | 1.6 / 2.7 | 4.3 / 6.6 |119| 10000 | zoom at full extent | all | 36.5 / 46.5 | 3.9 / 4.7 | 4.7 / 5.1 |120| 10000 | pan, 2 000 bars visible | all | 10.6 / 11.5 | 3.9 / 4.8 | 4.5 / 5.0 |121| 10000 | pan, 200 bars visible | all | 2.5 / 3.0 | 2.9 / 4.5 | 4.1 / 5.4 |122| 20000 | zoom at full extent | none | 9.9 / 10.4 | 2.0 / 3.4 | 4.2 / 5.5 |123| 20000 | pan, 2 000 bars visible | none | 2.2 / 2.6 | 1.9 / 3.1 | 4.4 / 6.3 |124| 20000 | pan, 200 bars visible | none | 1.2 / 1.5 | 1.3 / 1.8 | 4.1 / 6.5 |125| 20000 | zoom at full extent | all | 68.8 / 92.0 | 3.8 / 4.9 | 4.5 / 4.8 |126| 20000 | pan, 2 000 bars visible | all | 7.9 / 11.0 | 3.7 / 4.4 | 4.2 / 4.5 |127| 20000 | pan, 200 bars visible | all | 3.6 / 4.6 | 2.8 / 4.7 | 4.3 / 5.2 |128| 50000 | zoom at full extent | none | 16.2 / 18.9 | 1.8 / 2.4 | 4.1 / 5.3 |129| 50000 | pan, 2 000 bars visible | none | 2.1 / 2.4 | 1.4 / 2.1 | 3.9 / 6.2 |130| 50000 | pan, 200 bars visible | none | 1.5 / 2.5 | 1.1 / 1.3 | 3.6 / 6.8 |131| 50000 | zoom at full extent | all | 154.0 / 169.0 | 3.6 / 4.7 | 5.6 / 6.2 |132| 50000 | pan, 2 000 bars visible | all | 7.9 / 9.4 | 2.8 / 5.2 | 5.1 / 5.6 |133| 50000 | pan, 200 bars visible | all | 2.5 / 3.2 | 1.8 / 2.7 | 4.4 / 4.8 |134| 100000 | zoom at full extent | none | 29.2 / 32.3 | 1.8 / 2.1 | 4.4 / 6.5 |135| 100000 | pan, 2 000 bars visible | none | 2.1 / 3.4 | 1.9 / 2.5 | 4.0 / 5.1 |136| 100000 | pan, 200 bars visible | none | 1.2 / 2.1 | 1.1 / 1.6 | 3.9 / 5.9 |137| 100000 | zoom at full extent | all | 416.9 / 454.2 | 3.1 / 4.9 | 5.4 / 6.3 |138| 100000 | pan, 2 000 bars visible | all | 11.4 / 11.9 | 3.5 / 4.8 | 4.4 / 5.0 |139| 100000 | pan, 200 bars visible | all | 2.3 / 2.5 | 2.6 / 4.0 | 3.9 / 6.4 |140141## Results — off-screen full redraw (ms, median / worst of 10)142143| Bars | Bitmap | Indicators | 1.0.1 | 2.0 | 2.0 with 50 drawings |144|---:|---|---|---|---|---|145| 10000 | 2000 × 1280 px | none | 4.8 / 4.9 | 0.6 / 0.6 | 2.9 / 3.1 |146| 10000 | 2000 × 1280 px | all | 41.8 / 43.2 | 1.7 / 1.8 | 3.9 / 4.0 |147| 10000 | 5120 × 2880 px | none | 6.8 / 7.1 | 1.2 / 1.3 | 3.6 / 3.9 |148| 10000 | 5120 × 2880 px | all | 48.6 / 48.9 | 3.8 / 4.0 | 6.1 / 6.3 |149| 20000 | 2000 × 1280 px | none | 6.6 / 6.7 | 0.8 / 0.9 | 2.9 / 3.2 |150| 20000 | 2000 × 1280 px | all | 63.9 / 64.5 | 1.7 / 1.8 | 3.8 / 3.9 |151| 20000 | 5120 × 2880 px | none | 7.8 / 8.1 | 1.5 / 1.5 | 3.7 / 3.8 |152| 20000 | 5120 × 2880 px | all | 64.3 / 67.4 | 3.6 / 3.7 | 5.8 / 6.0 |153| 50000 | 2000 × 1280 px | none | 17.0 / 18.0 | 0.6 / 0.6 | 2.9 / 3.0 |154| 50000 | 2000 × 1280 px | all | 219.4 / 237.8 | 1.6 / 1.8 | 3.9 / 4.5 |155| 50000 | 5120 × 2880 px | none | 24.5 / 25.6 | 1.2 / 1.2 | 3.7 / 3.7 |156| 50000 | 5120 × 2880 px | all | 160.9 / 237.8 | 4.2 / 4.2 | 6.5 / 6.6 |157| 100000 | 2000 × 1280 px | none | 41.9 / 44.9 | 0.8 / 1.0 | 4.8 / 5.6 |158| 100000 | 2000 × 1280 px | all | 434.5 / 457.5 | 3.1 / 5.7 | 4.9 / 5.6 |159| 100000 | 5120 × 2880 px | none | 44.2 / 46.7 | 1.3 / 2.0 | 4.2 / 4.4 |160| 100000 | 5120 × 2880 px | all | 355.4 / 435.3 | 4.6 / 5.2 | 7.2 / 8.9 |161162## Memory (physical footprint, MB)163164| Bars | Run | Before loading | Series loaded | After its scenarios |165|---:|---|---:|---:|---:|166| 10000 | 1.0.1 | 82.9 | 84.9 | 482.5 |167| 20000 | 1.0.1 | 482.5 | 429.2 | 526.6 |168| 50000 | 1.0.1 | 526.6 | 535.3 | 633.6 |169| 100000 | 1.0.1 | 633.6 | 643.6 | 780.5 |170| 10000 | 2.0 | 298.5 | 300.7 | 636.9 |171| 20000 | 2.0 | 636.9 | 640.6 | 649.8 |172| 50000 | 2.0 | 639.9 | 596.5 | 691.4 |173| 100000 | 2.0 | 691.4 | 580.5 | 1385.6 |174175The footprint figures are dominated by what the harness itself allocates (window backing stores up to 3456 × 2000 px176and 5120 × 2880 px bitmaps from `ImageRenderer`, 59 MB each before release), and the runs are consecutive in one177process, so "before loading" of a row includes what earlier rows left behind. What can be read from them: loading a178series costs a few megabytes (10 000 bars: about 2 MB, the first row of each run), and the per-zoom-level caches of179the 2.0 renderer (at most 24 bucket lists and 96 line envelopes, each the series length divided by the reduction180factor) are not visible at this resolution. The idle footprint of the app is in `docs/TEST_REPORT.md`.181182## Reading the numbers183184- **1.0.1 renderer.** Fine up to a few thousand visible bars without indicators. With indicators it missed every185 frame once about 10 000 bars were visible (39 ms median at 10 000 bars, 165 ms at 50 000, 444 ms at 100 000), and186 without indicators from about 20 000–50 000 visible bars. `closure` is 90–95 % of `main` in those rows: the time was187 in the app's draw code, on the main thread.188- **2.0 renderer.** Over the 96 on-screen scenarios, 22 frames out of 23040 were missed189 (0.10 %). The highest median is 7.7 ms (50000 bars, 1728 × 1000 pt, zoom at full extent, all indicators, 50 drawings); the highest p95 is190 8.7 ms (50000 bars, 1728 × 1000 pt, zoom at full extent, all indicators, 50 drawings). 2 scenarios out of 96 have a p95 above the 8.33 ms budget: 50000 bars, 1728 × 1000 pt, zoom at full extent, all indicators, 50 drawings (p95 8.7 ms); 100000 bars, 1728 × 1000 pt, pan, 200 bars visible, all indicators, 50 drawings (p95 8.5 ms).191 The cost no longer grows with the series length (compare 10 000 and 100 000 bars): it is set by the window width,192 the number of indicator lines and the number of drawings.193- **Drawings.** 50 drawings add about 2–3 ms per frame in this Debug build (text of Fibonacci levels, notes and194 measure labels is resolved every frame). It stays within budget at the window size; at 1728 × 1000 pt with every195 indicator it is the configuration closest to the limit. A chart with 50 drawings is an extreme case, and the cost is196 per drawing, not per bar.197- **5K.** The off-screen full redraw at 5120 × 2880 px takes 2–15 ms depending on the series and the overlays198 (1.0.1: 7–355 ms). This is CPU rasterisation through `ImageRenderer`, slower than the on-screen path; an on-screen199 5K measurement needs a 5K display, which this machine does not have.200201## What changed in the renderer (the "cheap wins")2022031. **Aligned OHLC reduction, cached per zoom level** (`Downsampler.ohlcAligned`, `ChartModel.buckets(per:)`).204 1.0.1 re-merged the visible bars on every frame, starting at the first visible bar, so marks regrouped while205 panning. Buckets are now aligned on the series (bucket k = bars k·per … (k+1)·per − 1), computed once per reduction206 factor and sliced per frame. Extremes are still exact (unit-tested); the footer still states "1 mark = n bars".2072. **Indicator lines reduced like the bars** (`Downsampler.envelope`): first → low → high → last per mark instead of208 one vertex per source bar. A 50 000-bar SMA is now about 400 × 4 vertices, not 50 000; five overlays plus RSI and209 two MACD lines were the bulk of the 1.0.1 cost. The envelopes are cached per series and reduction factor.2103. **Time axis without a scan.** 1.0.1 asked the calendar for the day or month of every visible bar on every frame.211 The unit boundaries are now computed once per series and found by binary search.2124. **Comparison series aligned once** on the main series (an array indexed like the bars) instead of one dictionary213 lookup per visible bar and compared symbol per frame; they are reduced like any other line.2145. **Path batching**: grid lines in one path, candle bodies and wicks appended to four paths without intermediate215 `Path` values, no per-bar array allocation in the MACD panel.216217Nothing visual was traded for this: with fewer bars than marks (zoomed in), every bar is drawn as received, exactly218as in 1.0.1.219220## Decision221222Metal is **not adopted**. The condition set for adopting it — not holding the 8.3 ms budget where it matters — is not223met after the changes above: a pan or zoom of a 50 000-bar series (the server's maximum per request) with every224indicator costs 4.8 ms of main-thread work at the median in a Debug build, and no frame is missed. A Metal renderer225would still need the same reduction to one mark per ~2.5 pt (drawing 50 000 sub-pixel candles is wasted work on any226backend), would have to re-implement text, dashes, anti-aliased hairlines, PDF export (vector today, through the same227drawing code) and accessibility, and would add a second code path to keep visually identical in light and dark.228The numbers do not justify that.229230What would reopen the question: a measured miss on a 5K or 6K external display at 120 Hz with many overlays (not231measurable here), or a feature that needs tens of thousands of individually visible marks (tick charts, depth232heat-maps). The harness stays in the tree for that day.233234## Reproducing235236`Scripts/build.sh debug`, then the command at the top. Options: `-VQXChartBenchSizes 1000x640,1728x1000`,237`-VQXChartBenchFrames 240`. The report is JSON (rows, off-screen, memory, machine, display). The two reports behind238this page were kept outside the repository (`~/Library/Developer/VQuant/shots/chart/bench-before.json` and239`bench-after.json` on the machine that ran them, 2026-11-20).240