3 ms·
As if LaTex wasn't slow enough already. I'm always amazed at how long it takes to generate a PDF vs how quickly a browser can render a seemingly arbitrary HTML
by slaymaker1907 9y ago
As if LaTex wasn't slow enough already. I'm always amazed at how long it takes to generate a PDF vs how quickly a browser can render a seemingly arbitrary HTML document.
- Finnucane 9y agoThe browser doesn't care if the output looks good.
- leephillips 9y agoIndeed. You should be aware of the extensive computation that the TeX engine is doing in order to produce a typographically pleasing result - browsers do none of this.
- svat 9y agoThe book A Gentle Introduction to TeX is 97 pages long (number of pages in the output). To produce the typeset output from `gentle.tex`, on my laptop, - tex takes 0.15 seconds - pdftex takes 0.37 seconds - luatex (1.0.4) takes 0.46 seconds All of these are reasonably fast, and I think getting a full book in less than half a second is acceptable. (My browser takes longer than that to render most things.) What's the catch? This book is written in plain TeX. The slowness comes when you use LaTeX: it's not unusual to have even single-page documents that take longer for LaTeX to generate. The whole LaTeX approach is to have a package for everything, load everything you may want, providing all the features, etc — and all of this implemented in TeX macro expansion in painful and hard-to-refactor ways. This is something LuaTeX will help with actually: LuaTeX makes TeX less monolithic by providing hooks (callbacks), and many things can now be implemented in easier-to-read Lua code as hooks into the right parts of TeX's execution, rather than setting everything up at the start so that after macros are expanded the right thing happens. If there's less use of LaTeX and elaborate macros, things should get faster.
- jonsterling 9y agoFor some of my documents which use opentype fonts, the difference is by a factor of 20-30 between xelatex and lualatex.
- mpweiher 9y agoDo you have embedded graphics? My experience with many documents including a 300 page book was that (re-)encoding/compressing graphics was the bulk of the processing time (>90%). There is an easy fix: specify a lower compression setting. It defaults to the highest or close to the highest setting, which is inordinately more expensive.