[luatex] Identifying why LuaTeX 2023 is slower than LuaTeX 2022

Hans Hagen j.hagen at xs4all.nl
Mon Aug 28 17:30:26 CEST 2023


On 8/28/2023 4:49 PM, Paulo Roberto Massa Cereda wrote:
> Dear friends,
> 
> I beseech your wisdom. :) In my tests, I noticed LuaTeX 2023 is
> significantly slower than the 2022 counterpart. Here's a MWE:
> 
> --------8<--------
> Lorem ipsum dolor sit amet, consectetur adipiscing elit,
> sed do eiusmod tempor incididunt ut labore et dolore magna
> aliqua. Ut enim ad minim veniam, quis nostrud exercitation
> ullamco laboris nisi ut aliquip ex ea commodo consequat.
> Duis aute irure dolor in reprehenderit in voluptate velit
> esse cillum dolore eu fugiat nulla pariatur. Excepteur
> sint occaecat cupidatat non proident, sunt in culpa qui
> officia deserunt mollit anim id est laborum.
> \bye
> --------8<--------
> 
> Benchmark 1: texlive/2022/bin/x86_64-linux/luatex test.tex
>    Time (mean ± σ):     177.7 ms ±   1.4 ms    [User: 140.9 ms, System: 36.6 ms]
>    Range (min … max):   175.8 ms … 180.3 ms    16 runs
> 
> Benchmark 2: texlive/2023/bin/x86_64-linux/luatex test.tex
>    Time (mean ± σ):     286.7 ms ±   2.3 ms    [User: 246.1 ms, System: 40.3 ms]
>    Range (min … max):   284.0 ms … 291.2 ms    10 runs
> 
> Summary
>    texlive/2022/bin/x86_64-linux/luatex test.tex ran
>      1.61 ± 0.02 times faster than texlive/2023/bin/x86_64-linux/luatex test.tex
> 
> I initially had tried with LuaLaTeX and got similar results. Ulrike
> Fischer and Marcel Krüger kindly helped me find out what was going on,
> but we could not find anything relevant. I've tried:
> 
> - loading a custom OTF font: 2022 was 1.53 ± 0.02 (cold cache) and
> 1.83 ± 0.03 (existing cache) times faster
> - loading the default OTF font: 2022 was 1.68 ± 0.02 (cold cache) and
> 2.02 ± 0.03 (existing cache) times faster
> - HarfBuzz: 2022 was 1.57 ± 0.02 times faster (cold cache) and 1.84 ±
> 0.05 times faster (existing cache)
> - raw feature (normalize): 2022 was 1.81 ± 0.03 times faster
> - updated luaotfload-tool in TL2022: 2022 was 1.83 ± 0.01 times faster
> - no OTF: 2022 was 1.95 ± 0.02 times faster
> 
> I was wondering if someone could shed some light into this. :) Thanks!
I can't test it here (no 2022 installed and i;m also nto going to fdo 
that) but you need to define

- cold cache
- custom OTF
- default OTF
- raw feature

as i have no clue what that means here. Also, a simple single paragraph 
is no real test. How does it look for 50 pages. What for a more complex 
document of say 300 pages. In a simple test startup time (whatever needs 
to be initialized) kicks in. So, what if no fonts are loaded ta all. If 
you use plain, what fonts gets loaded by default.

I can't really compare (laptop windows 10) but using my plain version it 
needs .5 sec for a single li, 1.2 seconds for 100 pages of it, 4.48 
seconds for 500 pages.

As a comparison, context needs 5.2 sec for 500 pages in node mode and 
3.65 sec in base mode (luametatex: 5.15 and 3.45 with 1.6 sec spend in 
backend). Anywway over 80 pps for a simpel document like this which will 
of course drop down to 20-40 pps for a more complex document.

Some 0.1 seconds loss between versions is not dramatic unless if 
multiplies with largers runs.

(btw, i'd expect windows to be a bit more sensitive between years 
depending on native vs crosscompiled and tighter mem protection between 
versions.)

So, a question is: what is the fontless baseline? What if you compile a 
binary for your system yourself? Is this only plain or also other macro 
packages?

Another thing I can think of is that format loading time changed maybe 
because of a change in endian related storage. I remember some 
discussion about that (portable formats) and on intel byte swapping then 
kicks in. But again that's only startup time related.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the luatex mailing list.