Roadmap 0.10, Performance roadmap — wave 1
PERF.5 cc-dwg: writing an 8 MB drawing takes 5.4 s and 850 MB (Plans.dwg); reading 1.8 s. Target: write under 2 s
Measured 2026-11-08 (tools/perf/io-bench.mjs, Node 24): testfiles/powerline-plans/Plans.dwg, 8.2 MB, 288 objects, 50 blocks, 2 layouts: readDwg 1,834 ms; writeDwg 5,430 ms (9.0 MB out); 854 MB RSS. CPU profile of read + write: garbage collector 12 %, lz-r2004-write.js compressR2004 + best 16 % (hash-chain matcher, MAX_CHAIN 64, tokens as small arrays), writeDwg 5 %, nongraphic-write finish 3 %, buildModelParts 3 %, objects-write finish 3 %, BitWriter 3 %, bits-write bytes 4 %; the rest is spread thin.
Plan: (1) compressor: flat Int32Array token store instead of [at,len,dist] arrays, skip the lazy second search when the first match is long, compare 4 bytes at once before the byte loop; (2) BitWriter: grow by doubling and write words, not bytes, where the profile shows bytes(); (3) measure allocation in objects-write/nongraphic-write finish (many small Uint8Array copies); (4) run bin/test-dwg* round trips after each step; the autosave (dwg-autosave.js writes a full DWG after edits stop) feels this directly on big drawings. Reading is already off the page thread (read-async.js); the writer is not: consider a worker for saves over 2 MB.
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.