The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE
The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE
pdftex 1.28 (23) 2.07 (144) 6.96 (287) 30.94 (323) luatex 1.48 (20) 2.36 (127) 7.85 (254) 34.34 (291) The next table shows the same test but this time on a 2.5Ghz E5420 quad core server with 16GB memory running Linux, but with 6 virtual machines idling in the background. All binaries are 64 bit. engine 30 300 2000 10000 xetex 0.92 (32) 1.89 (158) 8.74 (228) 42.19 (237) pdftex 0.49 (61) 1.14 (262) 5.23 (382) 24.66 (405) luatex 1.07 (27) 1.99 (150) 8.32 (240) 38.22 (261) A test demonstrated that for LuaTEX the 30 and 300 page runs take 70% more runtime with 32 bit binaries (recent binaries for these engines are available on the ConTEXt wiki contextgarden.net). When you compare both tables it will be clear that it is non-trivial to come to conclusions about performances. But one thing is clear: LuaTEX with ConTEXt MkIV is not performing that badly compared to its cousins. The Unicode engines perform about the same and pdfTEX beats them signicantly. Okay, I have to admit that in the meantime some cleanup of code in MkIV has happened and the LuaTEX runs benet from this, but on the other hand, the other engines are not hindered by callbacks. As I expect to use MkII less frequently optimizing the older code makes no sense. There is not much chance of LuaTEX itself becoming faster, although a few days before writing this Taco managed to speed up font inclusion in the backend code signicantly (we're talking about half a second to a second for the three documents used here). On the contrary, when we open up more mechanisms and have upgraded backend code it might actually be a bit slower. On the other hand, I expect to be able to clean up some more ConTEXt code, although we already got rid of some subsystems (like the rather exible (mixed) font encoding, where each language could have multiple hyphenation patters, etc.). Also, although initial loading of math fonts might take a bit more time (as long as we use virtual Latin Modern math), font switching is more efcient now due to fewer families. But speedups in the ConTEXt code might be compensated for by more advanced mechanisms that call out to Lua. You will be surprised by how much speed can be improved by proper document encoding and proper styles. I can try to gain a couple more pages per second by more efcient code, but a user's style that does an inefcient massive font switch for some 10 words per page easily compensates for that. When processing this 10 page chapter in an editor (Scite) it takes some 2.7 seconds between hitting the processing key and the result showing up in Acrobat. I can live with that, especially when I keep in mind that my next computer will be faster. 318 Where do we stand
This is where we stand now. The three reports shown before give you an impression of the impact of LuaTEX on ConTEXt. To what extent is this reected in the code base? We end this chapter with showing four tables. The rst table shows the number of les that make up the core of ConTEXt (modules are excluded). The second table shows the accumulated size of these les (comments and spacing stripped). The third and fourth table show the same information in a different way, just to give you a better impression of the relative number of les and sizes. The four character tags represent the le groups, so the les have names like node-ini.mkiv, font-otf.lua and supp-box.tex. Eventually most MkII les (with the mkii sufx) and MkIV les (with sufx mkiv) will differ and the number of les with the tex sufx will be fewer. Because they are and will be mostly downward compatible, styles and modules will be shared as much as possible. Where do we stand 319
- Page 270 and 271: 268 Tracking
- Page 272 and 273: The order in which this happens now
- Page 274 and 275: normalizers characters words fonts
- Page 276 and 277: local function hyphenation(head,tai
- Page 278 and 279: 276 The order of things
- Page 280 and 281: of LuaTEX Taco and I worked in para
- Page 282 and 283: Next we see (scaled) Latin Modern:
- Page 284 and 285: As you can see, it is possible to a
- Page 286 and 287: next: U+FF008 { => U+FF06E { => U+F
- Page 288 and 289: end } commands = { { "slot", 1, bas
- Page 290 and 291: (a,b) = (1.20,3.40) So we don't nee
- Page 292 and 293: } description = "SOLIDUS", directio
- Page 294 and 295: ⎧ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎩
- Page 296 and 297: 840 italic 60 top_accent (0,1020) f
- Page 298 and 299: 296 Unicode math
- Page 300 and 301: tex.print("access") else tex.print(
- Page 302 and 303: 300 User code
- Page 304 and 305: namespace with code not coming from
- Page 306 and 307: • The code denes a few global tab
- Page 308 and 309: ut this now refers to an index in a
- Page 310 and 311: On the agenda is xing some ‘hyphe
- Page 312 and 313: We also use the opportunity to slow
- Page 314 and 315: Math. Because the TEX Gyre math pro
- Page 316 and 317: Tracing on Taco's machine has shown
- Page 318 and 319: node list callback tasks - 4 unique
- Page 322 and 323: July 19, 2009 - The number of files
- Page 324 and 325: July 19, 2009 - The relative number
pdftex 1.28 (23) 2.07 (144) 6.96 (287) 30.94 (323)<br />
luatex 1.48 (20) 2.36 (127) 7.85 (254) 34.34 (291)<br />
<strong>The</strong> next table shows the same test but this time on a 2.5Ghz E5420 quad core server with<br />
16GB memory running Linux, but with 6 virtual machines idling in the background. All<br />
binaries are 64 bit.<br />
engine 30 300 2000 10000<br />
xetex 0.92 (32) 1.89 (158) 8.74 (228) 42.19 (237)<br />
pdftex 0.49 (61) 1.14 (262) 5.23 (382) 24.66 (405)<br />
luatex 1.07 (27) 1.99 (150) 8.32 (240) 38.22 (261)<br />
A test demonstrated that for LuaTEX the 30 and 300 page runs take 70% more runtime<br />
with 32 bit binaries (recent binaries for these engines are available on the ConTEXt wiki<br />
contextgarden.net).<br />
When you compare both tables it will be clear that it is non-trivial to come to conclusions<br />
about performances. But one thing is clear: LuaTEX with ConTEXt MkIV is not performing<br />
that badly compared to its cousins. <strong>The</strong> Unicode engines perform about the same<br />
and pdfTEX beats them signicantly. Okay, I have to admit that in the meantime some<br />
cleanup <strong>of</strong> code in MkIV has happened and the LuaTEX runs benet from this, but on the<br />
other hand, the other engines are not hindered by callbacks. As I expect to use MkII less<br />
frequently optimizing the older code makes no sense.<br />
<strong>The</strong>re is not much chance <strong>of</strong> LuaTEX itself becoming faster, although a few days before<br />
writing this Taco managed to speed up font inclusion in the backend code signicantly<br />
(we're talking about half a second to a second for the three documents used here). On the<br />
contrary, when we open up more mechanisms and have upgraded backend code it might<br />
actually be a bit slower. On the other hand, I expect to be able to clean up some more<br />
ConTEXt code, although we already got rid <strong>of</strong> some subsystems (like the rather exible<br />
(mixed) font encoding, where each language could have multiple hyphenation patters,<br />
etc.). Also, although initial loading <strong>of</strong> math fonts might take a bit more time (as long as we<br />
use virtual Latin Modern math), font switching is more efcient now due to fewer families.<br />
But speedups in the ConTEXt code might be compensated for by more advanced mechanisms<br />
that call out to Lua. You will be surprised by how much speed can be improved<br />
by proper document encoding and proper styles. I can try to gain a couple more pages<br />
per second by more efcient code, but a user's style that does an inefcient massive font<br />
switch for some 10 words per page easily compensates for that.<br />
When processing this 10 page chapter in an editor (Scite) it takes some 2.7 seconds between<br />
hitting the processing key and the result showing up in Acrobat. I can live with<br />
that, especially when I keep in mind that my next computer will be faster.<br />
318 Where do we stand