Roadmap 0.13, Performance
PERF.79 CivilCraft past 2,000,000 points: autosave split over several stored records and the IFC surface written and read in parts
Autosave split built (stragglers civil 2026-11-28): app-autosave.js stores a journal base or change over 64 MB as records of about 48 MB with a marker written after its parts; small drawings are written exactly as before and old copies read as before (bin/test-autosave.mjs 69/0 with --browser, test-host 75/0, test-civilcraft 417/0, cap11 157/0). Proved on workstation11a with survey-5m (5,000,000 points, project.js served with the cap raised by the test only): open 14.8 s, move a point 123 ms, surface rebuilt off the page 12.9 s, first autosave copy stored as 10 records, change after it 401 KB, undo 108 ms, copy read back in 364 ms with 5,000,000 rows, no console error. NOT built: the IFC surface written and read in parts (ifc-civil.js one TIN entity line and one joined string; ifc-native.js productHashes parses the whole file; lib/ifc reader), so Save at 5 M and 10 M is unproven (0.11 measured the tab crashing) and MAX_POINTS stays 2,000,000.
Was: civil-12 measure (civil-12 2026-11-28), workstation11a, survey-2m (capped at 2,000,000 points), two runs: open 5.5 s, longest task 86-93 ms; move one point 54 ms, surface rebuilt off the page 4.8 s; AUTOSAVE: the first copy is one record of 193.8 MB written in 3.0 s (IndexedDB took it: stored 189.6 MB, one segment), each change after it 402 KB; SAVE (writePair): 8.1 and 8.6 s, JSON 144.2 MB + IFC 157 MB, JS heap 2.4-2.5 GB. Past 2 M (the 2026-11-22 run, 3,001,556 points): the first copy is 149 MB and every write aborts (value over 133,169,152 bytes), Save 13.9 s at 4.0 GB heap. What it would take: (1) app-autosave.js (shell's file) writes the journal base as ONE IndexedDB value: split it over records of at most about 64 MB and read them back in order; (2) the IFC writer (ifc-civil.js, the TIN is one entity line, the file one joined string, written twice) and productHashes(IfcFile.open(...)) written and fingerprinted in parts like lib/textout TextChunks. Half a day to a day with both; not built (over two hours, and (1) is a shared shell file).
Was: 0.11 (PERF.33, perf-finish-11) moved the points into typed arrays, streamed the open in a Worker, made point undo record only changes, fixed the 10 M edit stall (page and Worker shared Chrome's 4 GB heap during the rebuild) and wrote the project JSON in parts. Measured on workstation11a: 10 M points open in 31-33 s, move one point 244 ms, surface rebuilt off the page in 27.8 s (longest task 343 ms), undo 212 ms. The cap stays 2,000,000 in 0.11 because two shared pieces do not scale: (1) autosave: Windows Chrome refuses one IndexedDB value over 133,169,152 bytes; at 3 M points the first copy is 149 MB and every write aborts (shared app-autosave.js must split a copy over several records); (2) Save: the IFC writer (one TIN entity) and productHashes build it whole: 1.8 GB heap at 2 M, 4.0 GB and one 14 s task at 3 M, the tab crashes at 5 M and 10 M (write and read the IFC in parts, like lib/textout TextChunks). Also: Save at 2 M is one 8.8 s task. Estimate: half a day to a day. Then raise the cap (up to 16 M, the description Map limit) and prove open, edit, undo, autosave, Save and reopen at 5 M and 10 M on workstation11a. Test files: survey-5m / survey-10m (testfiles/LARGE-FILES.md).
lead 0.13 2026-12-04 (civil-13): surface goes to Save as typed arrays, IFC written in 20,000-point blocks, fingerprint read off the file bytes; output byte-identical under 2 M points. Measured on workstation11a, real page, app Save: 5 M Save 14.2 s; 10 M Save 29.5 s, fingerprint read 2.5 s, reopen 35.8 s with the same points and state. MAX_POINTS 2 M to 10 M. Peak JS heap 5.3 GB at 10 M. bin/test-civilcraft-ifc-parts.mjs 16/0. Not changed: project file over 200 MB opened without comparing the IFC beside it; IFC 4 and 2x3 export of a huge surface still one string.
Community comments
No comments yet
Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.
Sign in or create a free account to add a comment.