Closed (fixed)
Project:
D2: Declarative Diagramming
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Jan 2026 at 19:23 UTC
Updated:
20 Jan 2026 at 20:49 UTC
Jump to comment: Most recent
Comments
Comment #2
ergonlogicComment #3
ergonlogicWe need #3565334: Generate SVG from D2 input before we can cache the results.
Comment #4
ergonlogicComment #7
ergonlogicI added some basic caching. Initially I wasn't seeing any change in performance, but then realized internal render and page caching was probably nullifying my attempts to observe an improvement. So I disabled caching in our local dev environment, and saw a significant improvement with Apache Bench:
Note that this almost 3x improvement is mostly just process overhead, since the D2 diagram itself is trivial. The difference becomes significantly larger (>10x) with even a moderate D2 diagram (such as the one from the front page of https://d2lang.com).
We can explore more caching options (bins, tags, etc.) later. But this is definitely good enough for now.