You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Typst work on one .typ at a time. Iterating through multiple files require calling typst compile programmatically, spinning up and down OS processes.
It may be desirable for typst compile or typst watch to accept as inputs either
(nested) folders, or
*.typ within a single directory
Use Case
When users have many files (I'm working on a project with batches of 50,000 .typ), it may be more performant to spin up compile or watch once instead of once-per-file.
Reacted by Marco ཀ ʖ̯ ཀ, dizzib and Joseph Barbier
maybe. for 50k files, 50k compilers would be launched and it might not have a performance gain because rust programs already have a very fast launch speed.
rust programs already have a very fast launch speed.
Some programs maybe, but not typst. The bottleneck is typst loading system fonts per task. From previous stats, if you run typst without extra fonts on Windows 11 (default fonts), it would take 50k * 100ms = 5000 secs to load font data (compilation time excluded).
@ondohotola I get most right on the first shot, so compile is more frequent than watch. I don't think include can give me the outputs as separate files?
@Myriad-Dreamin This is interesting to note. My files take an average of 15 ms to compile, so a single Typst launch instead of many would take the compile times down 80%.
Activity
Enter-tainer commentedon Nov 22, 2023
maybe. for 50k files, 50k compilers would be launched and it might not have a performance gain because rust programs already have a very fast launch speed.
ondohotola commentedon Nov 22, 2023
In the meantime, what about generating a master.typ which includes all and watch that?
Myriad-Dreamin commentedon Nov 22, 2023
Some programs maybe, but not typst. The bottleneck is typst loading system fonts per task. From previous stats, if you run typst without extra fonts on Windows 11 (default fonts), it would take 50k * 100ms = 5000 secs to load font data (compilation time excluded).
jkwchui commentedon Nov 23, 2023
@ondohotola I get most right on the first shot, so compile is more frequent than watch. I don't think include can give me the outputs as separate files?
@Myriad-Dreamin This is interesting to note. My files take an average of 15 ms to compile, so a single Typst launch instead of many would take the compile times down 80%.
[-]Compile/Watch Folders or *.typ[/-][+]Batch compilation[/+]