On 11/20/2024 5:38 AM, Michal Hoftich wrote:

We had some conversations with Nasser off-list and found that the issue was
the huge number of large math environments. We use l3regex to escape
special characters in MathJax, but this significantly slows down the
processing. So, I will add a "fastmathjax" option that doesn't do this
post-processing. The downside is that it may result in DOM processing
errors, but DOM filters should be executed anyway with the current make4ht
version, so it isn't a big problem.

Best,
Michal


FYI;

This is update. Thanks to Michal's work, this below shows the final
speed timining with latest TL 2024 update:

The slow (default) version:
--------------------------

time make4ht -ulm default -a warning -c ./nma_mathjax.cfg  report.tex  
"mathjax,htm,4"

real 19m28.403s
user 17m21.158s
sys  0m26.286s

The fast version
----------------

time make4ht -ulm default -a warning -c ./nma_mathjax.cfg  report.tex 
"mathjax,htm,4,fastmathjax"

real 8m42.342s
user 6m37.606s
sys  0m26.627s

This is more than twice as fast as before.  The above is on
virtual box running Linux.

Notice that both "mathjax" AND "fastmathjax" options are needed to
get the fast version. Order is not important but both are needed.

For reference, on same file (about 600 PDF pages), lualatex gives

time lualatex -file-line-error -interaction=batchmode report.tex

real 1m31.532s
user 1m0.551s
sys  0m3.971s

May be one day Michal can find more magic ways to speed tex4ht even
more to make it even closer to lualatex speed.

Thanks,
--Nasser

Reply via email to