[lltx] pattern loading in luatex

Manuel Pégourié-Gonnard mpg at elzevir.fr
Thu Feb 24 14:17:30 CET 2011

Le 24/02/2011 10:33, Stephan Hennig a écrit :
> schrieb Mojca Miklavec:
>> They are not held in memory at all (the synonyms are), they are
>> loaded on demand. However in XeTeX they are (the same patterns are
>> first loaded as ngerman and then as dehyphn-x-2009-06-19; once from
>> out package and once from yours).
> That is interesting.  With LuaTeX being able to load patterns at
> run-time, there are now three different pattern loading strategies
> possible (that I can think of):
>   1.  Load all patterns in the format.
>   2.  Load all patterns unconditionally at start-up, but only
>       after loading the format.
>   3.  Load requested patterns on demand.
I'm afraid "load" is too imprecise to precisely describe what happens with
LuaTeX. There are now two possibly distinct operations:
a. read the patterns (as a string of characters)
b. process them into a form usable by *TeX (a trie)

With LuaTeX you have two options:

1. Read all patterns at initex time and store them as a string of characters in
the format; process them all at startup when the format is loaded.
2. Read and process requested patterns on demand.

Option 1 was used up to TeX Live 2009 and resulted in a long startup time.
Option 2 is implemented since TL 2010.

> Strategy 2 would already decouple patterns from the format and be a step
> into the direction of strategy 3.  My impression was (for whatever
> reason), that lualatex uses strategy 2 or at least it did once.

Sort of. I think it's better to use "read" and "process" rather than "load" to
accurately describe what happens.

>  Is it
> really true that, now, lualatex loads only requested patterns on demand,
> that is, it uses strategy 3?

> (Hm, is that what Manuel did before the TL 2010 release?  I'm surely not
> following your efforts closely enough.)

Now the next step is about babel: currently languages are statically allocated
(declared) in the format, and then defined (= loading the patterns) on demand.
It would be better to be able to dynamically declare languages at runtime. It
shouldn't be too complicated to do, I hope to get to it soon.


More information about the lualatex-dev mailing list