On 8/29/2023 1:55 PM, Paulo Roberto Massa Cereda wrote:
Hi Max,
Thanks so much for investigating! I've compiled LuaTeX on my end as
well and got similar results with both gcc and clang/llvm. I will poke
Karl about it. :)
Cheerio,
Paulo
So, what are we now looking at? A simple run test.tex with probably one
paragraph and a few fonts loaded (as it's plain). Different versions of
luatex, so there can be small changes, unlikely in the frontend, maybe
some in the backend but we're talking little output here. Is the same
fontloader used for every test (which assume stability over 2017 - 2023)?
Is the luatex build.sh used or some tex live one?
Anyway, we seem to be talking about 120 ms vs 160 ms for a simple
document so we can assume it is startup / initialization time. No
libraries loaded so that can be ruled out. Is the same lua used? These
.40 ms are noise to me anc can originate in several places (going into
details about possible bottlenecks in tex is bit off topic here) so the
question is how this goes for a 1000 ipsum paragraphs.
The simplest startup test i can come upwith (using context) is \stoptext
which gives me with the garden binaries:
3 batches of 100 runs: .244 sec average
when i compline on my laptop:
3 batches of 100 runs: .249 sec average
but i can actually get to this:
3 batches of 100 runs: .265 sec average
So guess what: as i mentioned before there has been a discussion about
portable fmt files (irr a latex request) and the normal luatex build
script has --no-dump-share but araiks tex live doesn't do that (any
longer) so then we get 0.020 sec per run more (2+ sec on 100 runes).
(plain has a very small format so one can wonder if it's the same there
as in other macropackages)
Of course there can be other factors in a non context universe like the
time needed to load a file database (wasn't there a upper / lowercase
checking change recently?), fonts etc. Then when we talk macro packages,
who knows what is done there to initialize matters, and it might be
engine or version dependent. A drop in performance of the engine might
be something one has to accept (as user and developer) but a drop in
performance of macro package is another matter and not something for
this list.
So, for now, maybe check out --no-dump-share and if that doesn't reveal
something, assume the .40 sec is lost forever (or at least for now)
Hans
Em ter., 29 de ago. de 2023 às 04:15, Max Chernoff <mse...@telus.net> escreveu:
Hi Paulo,
This seems to be an issue with the specific binary packaged in TL, not
with LuaTeX itself. This is what I get:
Benchmark 1: PATH=/tmp/texlive-testing/2017/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 132.3 ms ± 8.6 ms [User: 102.6 ms, System: 29.6
ms]
Range (min … max): 124.4 ms … 165.2 ms 23 runs
Benchmark 2: PATH=/tmp/texlive-testing/2018/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 131.5 ms ± 5.5 ms [User: 100.5 ms, System: 30.8
ms]
Range (min … max): 123.8 ms … 140.6 ms 23 runs
Benchmark 3: PATH=/tmp/texlive-testing/2019/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 119.1 ms ± 3.9 ms [User: 88.7 ms, System: 30.3
ms]
Range (min … max): 113.4 ms … 127.0 ms 25 runs
Benchmark 4: PATH=/tmp/texlive-testing/2020/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 119.3 ms ± 3.0 ms [User: 90.5 ms, System: 28.7
ms]
Range (min … max): 114.2 ms … 124.1 ms 25 runs
Benchmark 5: PATH=/tmp/texlive-testing/2021/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 117.4 ms ± 3.8 ms [User: 87.3 ms, System: 30.0
ms]
Range (min … max): 111.1 ms … 123.6 ms 26 runs
Benchmark 6: PATH=/tmp/texlive-testing/2022/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 117.8 ms ± 4.6 ms [User: 88.9 ms, System: 28.8
ms]
Range (min … max): 109.8 ms … 130.0 ms 25 runs
Benchmark 7: PATH=/tmp/texlive-testing/2023/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 118.8 ms ± 4.0 ms [User: 88.4 ms, System: 30.3
ms]
Range (min … max): 112.1 ms … 126.0 ms 26 runs
Benchmark 8: PATH=/tmp/texlive-testing/2023-initial/bin/x86_64-linux:/bin/
luatex test.tex
Time (mean ± σ): 126.9 ms ± 4.5 ms [User: 96.5 ms, System: 30.3
ms]
Range (min … max): 120.9 ms … 135.5 ms 23 runs
Benchmark 9: PATH=/tmp/texlive-testing/sys/bin/x86_64-linux:/bin/ luatex
test.tex
Time (mean ± σ): 166.7 ms ± 4.0 ms [User: 136.5 ms, System: 30.1
ms]
Range (min … max): 162.5 ms … 175.9 ms 18 runs
Summary
PATH=/tmp/texlive-testing/2021/bin/x86_64-linux:/bin/ luatex test.tex ran
1.00 ± 0.05 times faster than
PATH=/tmp/texlive-testing/2022/bin/x86_64-linux:/bin/ luatex test.tex
1.01 ± 0.05 times faster than
PATH=/tmp/texlive-testing/2023/bin/x86_64-linux:/bin/ luatex test.tex
1.01 ± 0.05 times faster than
PATH=/tmp/texlive-testing/2019/bin/x86_64-linux:/bin/ luatex test.tex
1.02 ± 0.04 times faster than
PATH=/tmp/texlive-testing/2020/bin/x86_64-linux:/bin/ luatex test.tex
1.08 ± 0.05 times faster than
PATH=/tmp/texlive-testing/2023-initial/bin/x86_64-linux:/bin/ luatex test.tex
1.12 ± 0.06 times faster than
PATH=/tmp/texlive-testing/2018/bin/x86_64-linux:/bin/ luatex test.tex
1.13 ± 0.08 times faster than
PATH=/tmp/texlive-testing/2017/bin/x86_64-linux:/bin/ luatex test.tex
1.42 ± 0.06 times faster than
PATH=/tmp/texlive-testing/sys/bin/x86_64-linux:/bin/ luatex test.tex
The "20xx" binaries are freshly-built versions of the LuaTeX source from
that year, "2023-initial" is the LuaTeX binary initially included with
TL23, and "sys" is the current TL23 LuaTeX binary (there was a mid-year
update this year). All the tests used an up-to-date TL23 tree, with only
the LuaTeX binaries modified. I've attached the full test script.
"2023" (1.01 ± 0.05), "2023-initial" (1.08 ± 0.05), and
"sys" (1.42 ± 0.06) were all compiled from the same sources (mostly) and
with the same compilers (I think?), so I'm not sure why the current
binaries have such a large regression. Compiler flags maybe? I think
that Karl built the current TL23 binaries ("sys"), so he might know
more.
Thanks,
-- Max
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------