# Design loading `solvecraft-cli bench-open design.solvecraft` reports JSON lines for file reading, JSON decoding and migrations (including input-name repair), timeline evaluation, individual features, and world placement/display meshing. `--parse-only` stops before geometry evaluation. The parse timer includes document validation and repair, not just the JSON parser. Windows x64, optimized `ci` profile, measured during other builds: | Design | Parse/repair | Evaluate | Display meshes | |---|---:|---:|---:| | 19-feature enclosure, 34 KB | 1.2 ms | 14.9 s | 6 ms | | 25-feature assembly, 15.2 MB, 2,990 bodies | 21 ms | 12.5 s | 2.1 s | | Generated 1,000 independent boxes, 185 KB | 5 ms | 0.82 s | 0.15 s | | Generated 5,000 boxes in five grids, 10 features | 0.45 ms | 17.6 s | 0.81 s | The enclosures spend most of evaluation in joins and cuts, not parsing. Designs save feature definitions; opening them rebuilds their geometry. Those times remain after the repair fix. A separate generated timeline with missing input names reproduced minutes in the reader: | Timeline (geometry rolled back) | Parse/repair before | After | |---|---:|---:| | 2,000 boxes, 6,000 unnamed inputs | 78.1 s | 10–20 ms | | 5,000 boxes, 15,000 unnamed inputs | interrupted after 131 s, still repairing | 26–46 ms | Previously, each missing input restarted the `d1`, `d2`, … search, scanning the document for every candidate. This approaches cubic work as unnamed inputs accumulate. Loading now reserves names once and assigns missing names with an advancing cursor. Existing names, names on later features, parameter collisions and reuse of surplus names retain the previous behavior. Regression tests compare the old and bulk repairs and load a 5,000-feature unnamed timeline. # Viewport performance Measured with the control channel (`ui.inspect` `frame_ms`: CPU time of one UI frame, which includes picking under the cursor) on the sample plate patterned 20 × 20 (400 bodies, about 600k triangles), 1600 × 1000 window under Xvfb, release build. Hover: 60 cursor moves across the model; orbit: a right-drag. | | hover median | hover p90 | orbit median | |---|---|---|---| | before | 18.7 ms | 37.5 ms | 21.0 ms | | after | 1.9 ms | 2.4 ms | 2.6 ms | | after, Browser hidden | 0.4 ms | — | 0.4 ms | What changed: - **Picking culls by bounding box.** Per-body boxes are cached until the model changes. The face raycast skips bodies whose box the ray misses or enters behind the nearest hit so far. Edge and vertex tests skip bodies whose box, projected on screen, is not under the cursor. - **Picks are reused** while the cursor, camera and model are unchanged, and **no picking runs while the view moves** (orbit, pan, zoom). - **The model extent is cached** (it sets the view's depth range and was recomputed from every mesh several times per frame). With 49 bodies the frame was already 2.8 ms (hover) before these changes. The remaining frame time with the Browser shown is mostly the Browser listing every body row. GPU ID-buffer picking was not needed at this size. ## Browser Same model and method (400 bodies, Bodies folder open, 60 hover moves over the viewport): | | median | p90 | |---|---|---| | Browser shown, before | 1.95 ms | 2.71 ms | | Browser shown, after | 0.72 ms | 1.19 ms | | Browser hidden | 0.30 ms | 0.72 ms | What changed: rows scrolled out of view only reserve their height. They register no widgets and paint nothing (no text layout, icons or eye/fold buttons), so the cost follows the rows on screen rather than the rows in the tree. Scrolling, Find in Browser and drag and drop still see every row's place. # Recompute performance `solvecraft-cli bench-edit