0

I need to make a web service that would generate a lot of PDFs one per request under (somewhat) high load. I was told by my college that if I set up LaTeX or ConTeXt as a daemon it will stop taking time for initialization and generation will work much faster. However I fail to find much information about such daemonization. Also I doubt that it's initialization that takes bulk of the time. It looks like the macros themselves are slow and cpu-bound.

My question is: is there a solution to daemonize either LaTeX or ConTeXt in such way that it really makes a significant boost in compile time for PDF generation?

Gherman
  • 153
  • 6
  • No, there isn't. Neither LaTeX nor ConTeXt have such a mode and as you noted this would not lower relevant costs anyway. – TeXnician Mar 16 '21 at 17:56
  • As @TeXnician says, ConTeXt doesn't have such modes. However, for a boost in compile time, at least for simpler documents, you could try with --once and other related options in context and mtxrun –  Mar 16 '21 at 18:04
  • Unfortunately, this is technically impossible. Central things like the output file handle or the main vertical list are global variables in the common TeX implementations and cannot be reinitialized. This would require a redesign of TeX from the ground up (as was done for NTS but that project has been abandoned over two decades ago). – Henri Menke Mar 26 '21 at 20:11
  • NTS was reimplmented as εχTeX, which I made a limited attempt to modernize. – Dave Jarvis May 18 '21 at 20:48
  • do you need a standard format? using a custom pdftex format with just the macros you need pre-loaded can speed things up a lot. If you are making multiple files that are structurally similar this can be big win. If you are accepting arbitrary user documents then less so, – David Carlisle May 20 '21 at 11:30
  • @DavidCarlisle The files are structurally similar. But the amount of rows within tables is different for every user. And the amount of tables is different. What is standard format exactly? – Gherman May 20 '21 at 11:58
  • 1
    I did some experiment with this https://tex.stackexchange.com/a/639255/250119 but that attempt breaks in a few cases. – user202729 Jun 27 '22 at 06:29

0 Answers0