Repository navigation
Improve workflow compilation performance - #1106
cookingwithvlad-del wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review.
|
|
Adapted the lane/step indexing from Added a rendered-SVG regression with a valid main path, an off-path node and edge/node animation metadata. It checks steps 0/1 for the path, 4 for the off-path node, and 0 for the path edge. Sixteen complete before/after compiler results matched, covering both quality profiles, maintained examples, unknown lanes, duplicate nodes and empty lanes. Independent synthetic measurement on Node 22.23.2/macOS arm64: 2,000 lanes and 2,000 nodes, two warmups and ten alternating measured samples per revision. Median compilation was 36.09 ms → 10.45 ms, with identical complete output hashes. This measures the stress fixture only. Validation on our adapted fork: 175 focused tests; 3,481 general passes with 134 conditional skips; 315 Chrome passes with 10 skips; 56 final packaging checks. The installed package matches all 215 managed files, and Node 22/26 compiler/CLI and previous-customization probes pass. The retained MIT base and the adapted portions’ Apache-2.0 license/NOTICE are preserved. BlueboxC |
tt-a1i
left a comment
There was a problem hiding this comment.
Agent-assisted review at 3233ebcd7100bec64fb6450ed6345c78ee80153a, compared with dev e837dc4. Source and supplied evidence inspected; no local test rerun in this pass.
Thanks for the measured comparison. The narrow scope is worthwhile: precompute lane prefixes and first-occurrence node indexes while preserving existing arithmetic, duplicate-ID handling and animation steps. Scope agreed for this slice; the other nine inspection candidates are outside it. The implementation retains those semantics on inspection, and the stress timing/output digest plus existing focused checks are proportionate evidence. No five-diagram authoring benchmark is required for this result-preserving optimization. Please integrate current dev, retain the original history, refresh the canonical package and let the relevant CI finish; the current zip-freshness failure must be cleared before final acceptance. BlueboxC’s additional equivalence/mainPath results are corroboration from its adapted fork, not a claim that upstream ran them. Keep the stress-only timing qualification and contributor accountability explicit.
Problem and value
laneTop()recomputed preceding lane heights withslice().reduce()on every lookup, andnodeStep()usedfindIndex()for each node outsidemainPath. Both repeat work as workflow size grows. This PR precomputes lane tops and first-occurrence node indexes once per compile.10b4dd5cand candidate3233ebcdruns on Node v24.22.1 with a synthetic 2,000-lane/2,000-node workflow (10 samples per revision). Median compile time was 30.14 ms → 11.90 ms; p90 was 47.72 ms → 14.51 ms. Both produced a 2,323,000-byte SVG with the same SHA-256 (6a93f25dbc5c4cb5ffc9641362329333eec26fb96817b2dcf79bfb9e28c03631). This is a stress-case measurement, not a claim about typical workflows.AI assistance and accountability
Stability impact
Tests run
origin/devat10b4dd5c; candidate:3233ebcd.npm run test:focus -- test/workflow-compiler.test.mjs test/workflow-compiler-call-contract.test.mjs test/workflow-compiler-hard-contract.test.mjs test/workflow-automatic-width.test.mjs test/workflow-counterflow-spacing.test.mjs— passed, 165 tests.git diff --check— passed.Ten performance improvement candidates identified
nodeContext()instead of scanning both collections for every node (workflow-compiler.mjs,createWorkflowLaneGeometry).workflow.edges.indexOf()while assembling route/label diagnostics (workflow-compiler.mjs).routeFirstpass instead of callingworkflow.edges.find()(workflow-compiler.mjs,validateReadablePinnedGeometry).document.nodes.find()calls used while probing capacity repairs (workflow-compiler.mjs,createLegacyCapacityRepair).shared/legend.mjs, collision placement).dataflow-compiler.mjs, Showcase automatic layout).indexOf()while building route candidates (dataflow-compiler.mjs, label routing).find()/findIndex()scans during label repair (dataflow-compiler.mjs).placedfor every parent (waterfall/render-waterfall.mjs).Items 2–10 are inspection candidates, not individually benchmarked or included in this change.