Reduction of the per-page layout time growth
I noticed that the time to create the layout of a page grows with the amount of pages that were processed already. I've been experimenting with a rather large document and this increase can make a whole build take a really long time.
Perhaps this is something that has to do with my input document? Are there any general tips on how the input document/css rules should be structured in order to reduce this growth?
Mine looks like this:
body section.cover section.toc section h1 section h2 [content...] section h2 [content...] ... ...
[content...] being paragraphs and divs (with KaTeX rendered math)
As a side note, I've ran a profiling session with the Chrome dev tools. It turns out that commenting out this line really helps bringing down the increase, enough so to reduce my 2hours+ build to ~25min. Indeed the modification of the pages root element's style appears to cause a "restyle" browser task for the whole document, for each page added. That restyle happens when this line is executed. I am unsure of the use of this variable (I've found it there only), I could not find any visual change on my document after disabling it. Is it safe to do so?
Thanks for your time on this project, by the way!