-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
low prioritywait, wait, wait, do I really need this?wait, wait, wait, do I really need this?
Description
Strategies for Fast Typst Compilation
Collected from Typst Forum and debugging slow compilation.
Diagnostics
- Use
--timingsflag:typst compile --timings timings.json reductions.typthen load into Perfetto to identify bottlenecks - Use
typst watchfor incremental compilation (much faster thantypst compilefrom scratch) - Compile locally — the CLI is faster than the web app
Document Structure
- Split into chapter files: Use
#import "template.typ": *per chapter, compile individual chapters during editing - Use external data files: Store data in JSON and load with
json()rather than computing in Typst code. Already adopted in our paper viamake examples - Avoid redundant imports: Use a central template file for shared definitions
Performance
- Pre-generate figures separately: If graphics don't change, generate them independently and embed results (e.g., our approach: JSON data → cetz rendering)
- Minimize heavy packages:
cetzandfletcherare known slow packages. For simple tables/matrices, prefer native Typsttable()andmath.mat() - Batch compilation: Split multi-version projects into smaller chunks
Our Current Setup
make examplesgenerates JSON data files from Rust examplesmake paperdepends onexamples, then compiles the Typst documentreductions.typloads JSON withjson()for data-driven content (example boxes, resource estimation table)- Petersen graph visualization uses pre-computed JSON rather than Typst-side computation
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
low prioritywait, wait, wait, do I really need this?wait, wait, wait, do I really need this?