On 8/5/2026 10:13 AM, Max Chernoff via ntg-context wrote:
I don't think that there's anything that can be done about (1), since
expl3 isn't slow because it's bloated or poorly-written, but because it
offers so much functionality. So unless expl3 loses functionality
somehow, there's probably no way to fix this. But the expl3 load times
in ConTeXt are _so_ much better since Joseph reimplemented the Unicode
table stuff in Lua, so maybe there are some other similar places that
can be sped up.
if people use something that needs expl than i suppose that the loading
overhead can be neglected .. similar to using tikz
and bloat ...all depends on ones interpretation of bloat but i don't see
it as my job to check that (last time i peeked at it was when we had to
look into some latex math/noffonts issue which then also loaded expl and
i had to get around some stuff in order to figure out the why of that
issue but i don't want to feedback on somthing that i haven't written
myself of doesn't relate to context)
If you can't implement something in Lua, then you're not trying hard
enough ;).
indeed
but even I have never used it in ConTeXt before. expl3 is unbeatable for
when you need to program things using only TeX macros, but expl3 is
even then one should wonder: why program that in tex at all
It depends. Lua is generally faster than expl3, but not usually by that
much:
https://github.com/latex3/latex3/pull/1557#issuecomment-2226765469
and expl3 is nearly always faster than if you were to implement
something using "classic" TeX macros.
oh, benchmarks ... i don't know the code but my personal take on
benchmarking tex is:
- timing specific macros is a local thing, and as tex is very memory
intense the cpu cache keep nicely populated; timing lua is very much
influenced by the GC (and a few other things);
- suboptimal tex or lua code can have quite some impact as can have
timing itself; i would have to see the specific (small) tex vs lua
varant to see if it matters and/or scales up (not that i see it as my
task to optimize latex)
- in practice the time is often spent in different locations, i have
plenty of cases where i can/could squeeze out performance but it can
also drown in the rest of the run (it is a bit of pet project to get
Mikaels math book run under 6 seconds so we're talking accumulated .002
kind of improvements there)
- that's why whenever i read about timing and performance (also compared
to tex competitors) i can often see where that smells wrong (also
related to the task); i know quite well when we've reached the limits
and/or where there is room for some gain
- run some music in the background, keep the broweer open, and runtime
get more affected than by small improvements
- of course it can boost one ego a bit when things look faster (even in
ones perception)
It definitely takes a bit of practice to get used to it, but I find it
_much_ easier to read than the \cl@ss@c\@@style of writing macros that
"plain.tex" and the 2e kernel use.
ok, so relative to @ @ @ @ stuff .. equally bad indeed
context and latex are just different things, the fact that there are
some cross-package modules is nice but not a target (as people can just
use the macro package that provides them what they need)
This isn't really useful for a markdown package, but it's great for
drawing packages since it means that you never need to recompile
unchanged drawings.
could be, but it assumes latex is installed I guess; that said: in these
times i have to keep in mind (1) not enough memory on the market to
satisfy endless growth, (2) using older hardware as i can't afford
upgrading, (3) using less energy to process - occasional fast runs in an
editing workflow, (4) staying away from dependencies, etc., (5) being
prepared for the worst
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
___________________________________________________________________________________