[tex4ht] performance of tex4ht on WSL linux vs. VBox linux

Nasser M. Abbasi nma at 12000.org
Mon Nov 18 00:52:49 CET 2024


On 11/17/2024 3:55 PM, Michal Hoftich wrote:

> That is a huge difference! Did you try WSL to run Linux on Windows? I don't
> think you need a new PC just for this.
> 

Yes, I did. This was in my first email:

----
Compiling to HMTL only on VBox gives

real 8m52.232s
user 4m18.212s
sys  0m42.791s

On WSL 2.0, same command gives

real  6m12.639s
user  3m38.296s
sys   0m7.305s
----------------------

WSL is little faster as you see, by about 30%, but both still
slow compared to lualatex.

But good news. I got make4ht to work on windows with miktex.
This is the timing. It run the command 3 times:

-------------
G:\public_html\my_notes\ODE_algorithms>ptime.exe make4ht --shell-escape -ulm default -a warning -f html5+join_colors -c nma_mathjax.cfg -e MAIN.mk4 index.tex "mathjax,htm,5,fn-in,notoc*,p-width,charset=utf-8,cut-fullname,nostyle" "-cunihtf -utf8"

ptime 1.0 for Win32, Freeware - http://www.pc-tools.net/
Copyright(C) 2002, Jem Berkes <jberkes at pc-tools.net>

===  make4ht --shell-escape -ulm default -a warning -f html5+join_colors -c nma_mathjax.cfg -e MAIN.mk4 index.tex "mathjax,htm,5,fn-in,notoc*,p-width,charset=utf-8,cut-fullname,nostyle" "-cunihtf -utf8" ===
This is LuaTeX, Version 1.18.1 (MiKTeX 24.4)
  system commands enabled.
This is LuaTeX, Version 1.18.1 (MiKTeX 24.4)
  system commands enabled.
This is LuaTeX, Version 1.18.1 (MiKTeX 24.4)
  system commands enabled.

Execution time: 344.662 s
-------------------------

This is 5m 7s. Compared to WSL 6m 12s.

So little faster by about 10%. But not to the degree
that lualatex was faster on windows vs. WSL which was 12 times as fast.

So this tells me that there exists an inhert slowness in tex4ht
and not due to use of virtual box or WSL, although with lualatex the
difference is much clear there.

Here is summary table of performance. All on same latex file of
about 500 pages.

           +---------------+---------------+----------+
           |window/Miktex  |  WSL/TexLive  | speed up |
----------+---------------+---------------+----------+
lualatex  |  0m 9.4s      |  1m 15s       |7.5 times |
----------+---------------+---------------+----------+
make4ht   |  5m 7s        |  6m 12s       |1.08 times|
----------+---------------+---------------+----------+

It is also possible that tex4ht is not optimised for windows like
lualatex is?

But tex4ht is really slow for large files. This is a big problem
and I wish someone could find out where this slowness comes from. My
guess is that it is from dvilualatex because when make4ht is running
I see this most of the time in output of top command on linux.

I will be happy to make a zip file of the above file with everything
needed to compile it if someone wants to try themslefs. This file
has some math and some images. Nothing special. This is link to the
actual result if you like to see it

<https://12000.org/my_notes/ODE_algorithms/index.htm>

Thanks,
--Nasser



More information about the tex4ht mailing list.