Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Luaotfload is not as optimised as ConTeXt #6

Open
khaledhosny opened this issue May 26, 2010 · 5 comments
Open

Luaotfload is not as optimised as ConTeXt #6

khaledhosny opened this issue May 26, 2010 · 5 comments

Comments

@khaledhosny
Copy link
Owner

For example, fonts taking huge amount of memory and forever to load, like Arno Pro, take much less time and memory when used with ConTeXt. Someone needs to discuss this with Hans, may be we can share more code than we do now.

@zhouyan
Copy link

zhouyan commented Oct 7, 2011

I guess the problem here is that ConTeXt use precompiled font cache. For example see http://source.contextgarden.net/scripts/context/stubs/mswin/luatools.lua, where the caches.loaddata first try the compiled version than the text version. In particular of Arno Pro, which is very complicated, I tried the following.

First compiled a document which use almost all the Arno Pro fonts (well, one can construct a document with only those he is likely to use).

Second, now we have temp-arnopro-*.lua files in the cache directory. I use texluac compiled all these files to binary files, and renamed binary files with the ordinal names of *lua files.

Third, try the same document again, the output is correct, the compile time reduced from more than 3 minutes to 22 seconds in my case.

This is surely a very very ugly way to do it. It trick luaotfload to load a compiled file instead of plain text file by renaming the binary file to the same names as the *.lua files.

A better way is to patch luaotfload in a similar way to what context do. However, I am not familiar with either luaotfload source of context source, and never had time to look into them carefully enough to create patch myself. But hope the idea an experiment I mentioned above will help.

@khaledhosny
Copy link
Owner Author

I had a patch that would enable compiling cache files, but one have to run luatex with --shell-escape which is not the default (I've to call texluac from inside the module to compile the file), so I'm not sure how useful is that. Also I'm not getting that much saving, ~1 second in a plain tex file using 18 fonts.

@khaledhosny
Copy link
Owner Author

I found that I can use string.dump, patch sent to Hans and we should get support for compiled cache files with next sync with ConTeXt.

@zhouyan
Copy link

zhouyan commented Oct 8, 2011

For the time saving, I think that really depends on the fonts, since only the compile time is saved and runtime is still the same.

In addition it is also OS dependent. In may case I always found that in Mac OS X it is much slower than in Linux (the hardware difference is marginal in the sense of linpack benchmark)

@khaledhosny
Copy link
Owner Author

This is now available in the unstable branch, please test (you may need to delete existing cache files first.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants