#Any tips forPerformance improvements?

13 messages · Page 1 of 1 (latest)

sleek creek
#

I have a 15-20 page text heavy template file, with few data points to load from json file (may be 10-15 data points). When I am doing load testing the generation of pdf is taking around 800ms. Is there some performance tips I can apply to speed up the generation?

covert quiver
#

Are you doing clean or incremental compilations, i.e. typst compile or typst watch?

sleek creek
#

typst compile as each time json files will be different

covert quiver
#

hmm, yeah. then I think there is not much you can do from your side unfortunately.

#

Typst could in theory be a bit faster if it was all one process invocation (less font loading etc.), but there is no way to do that atm.

#

except of course for doing everything in one doc, but that yields problems with heading counters etc.

dense warren
#

If I remember correctly, typst watches for jsons, that #read("file.json"), so you can run typst watch, and do something like

cat 1.json > common.json
# wait a bit
mv main.pdf 1.pdf
covert quiver
#

yeah, maybe you can build something with that.

sleek creek
#

Ok

dense warren
#

instead of just sleeping on compilation, you can watch for .pdf change

sleek creek
#

Should there be a background process which needs to constannlty running for typst watch?

dense warren
#

yes, if you terminate typst, how it will compile? 🙂

#

if you have different json files, how are you read them? manually replacing path for each new compilation? something like sed? using latest typst and sys.inputs?