Tinymist using more than 30gb of RAM on a reasonable size project

I’m writing my PhD thesis in typst

My current setup is Helix editor together with tinymistLSP with live preview.

Here is the project repository. (note that you probably must change the text font and math font to compile).

My thesis is filled with diagrams like these:

With thesis growing grew the RAM usage. Now it takes more than 30gb of DDR4 ram to work on the project (sometimes tinymiststart to use swap memory). At first, I tried to move all diagrams into separate file, but it did nothing to the RAM usage, if not made it worse.

  • Is there a way to write typst code more efficiently?

  • Is it a fletcher problem, or any other package with similar functionality will yield same high RAM usage?

  • Is it an inefficiency in tinymistLSP?