On 10/30/2026 9:09 AM, Thomas A. Schmitz wrote:
Hi all,
Not a question, not a complaint, just a little observation I have made and that
may be of interest to some of you: for my ConTeXt compilation, I have written a
small wrapper script that saves the time compilation takes. My main computer is
an intel iMac. I double-boot it, with macOS running from its internal SSD,
several linux distributions from an external SSD connected via USB. When I look
at the collected data, I see that linux is almost invariably faster, sometimes
around 50% faster. There are a few outliers (maybe first run after an update?),
but the picture is pretty consistent. So I am just wondering what makes macOS
so slow, even though it should be on a faster disk. Is it the internals of the
os? Or the way the metaluatex binary is compiled? Anyways, I append a small
comparative t
able. All the files are xml files, if that makes a difference.
All best wishes
Thomas
| file | macos | linux |
+=======+=======+=======+
| fileA | 00:26 | 00:19 |
| fileB | 00:16 | 00:24 |
| fileC | 00:13 | 00:05 |
| fileD | 00:05 | 00:04 |
| fileE | 00:32 | 00:26 |
| fileF | 07:40 | 11:20 |
| fileG | 00:07 | 00:12 |
| fileH | 00:22 | 00:17 |
| fileI | 00:11 | 00:08 |
| fileJ | 00:23 | 00:16 |
| fileK | 00:05 | 00:02 |
| fileL | 00:42 | 00:15 |
| fileM | 00:26 | 00:22 |
| fileN | 00:11 | 00:21 |
| fileO | 00:57 | 00:45 |
| fileP | 00:05 | 00:02 |
| fileQ | 00:11 | 00:05 |
| fileR | 00:23 | 00:20 |
| fileS | 00:16 | 00:13 |
| fileT | 00:22 | 00:16 |
| fileU | 00:07 | 00:12 |
| fileV | 00:09 | 00:17 |
| fileW | 00:31 | 00:14 |
+=======+=======+=======+
Actually the linux binaries migh not even be the fastest possible
because we compile on the build with an old compiler and setup (will be
updates soon) while on e.g. my linux box it compiles more efficient and
also does link time optimization. We mostly test linux on Mikaels chrome
book where a 300 page math book with some 3K formulas takes 5 sec (that
we want to bring down to 3 sec so we have some work todo).
Factors that influence a run are the console (use --silent to test) and
apple is not the fastest there. Then there is the file system but that
is unlikely to be a cause. You use the same cpu so the cpu cache is not
relevant. Running from a editor can slow down too (vscode is slow for
instance).
What might make a difference is that the intel compilation might not use
the mimalloc route so then we have a slower lua and xml is pretty much a
lot of lua; tex manages its own memory so that has little influence there.
On my windows machine, when I compile on wsl it actually can be faster
than on windows (usually with a vm it relates to the host doing the file
stuff so a bit more multiple core). Processing the test suite in wsl
takes 240 sec vs 400 sec on windows which is due to different 'context
switching' when processing parallel on 4/8 cores (--parallel etc). A
nice test is making a format (some 2+ sec on windows, and 1.5+ on wsl).
Processing the 750 page luametatex manual is a nice test case: 15 sec on
my windows machine (from scite, i.e. fast console). On a rpi 5 it's 1.5
times slower (one can compile locally to get better bins, and profiling
might also boost a bit). On the arduino uno that manual takes 6 times
what the laptop does. And wsl needs 12 sec. (Of course a modern machine
will do the job in 5 sec but the fact that I can't afford a new one
makes me invest in speedign op the engine etc. So a slow machine pays
off in terms of trying to speed up.)
An arm mac is of coure faster than your intel, Keiths old M1 is about
1.2 times faster than my old xeon 1505m laptop. Can you test a modren mac?
When you run a file with --profile you get an extra log file where you
can see where lua spends time. Maybe that gives a clue.
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________