[luatex] Why accessing font.fonts table is so slow?

Khaled Hosny khaledhosny at eglug.org
Fri Jul 30 09:19:19 CEST 2010


On Fri, Jul 30, 2010 at 09:07:49AM +0200, Taco Hoekwater wrote:
> On 07/29/2010 09:48 PM, Khaled Hosny wrote:
> >After struggling the whole day trying to figure out why my less than 300
> >lines of code are so slow, I found that all the slowness comes from
> >accessing font.fonts table, which would take from 0.02 to 0.07 seconds
> >each time, getting rid of that drops my test file from ~16 to ~2
> >seconds. Now I'm just wondering if this slowness is expected, and
> >wither it deserves a small warning in the manual (it would have saved my
> >day if I knew it beforehand), I read it is not a real table, but nothing
> >suggests the slowness I'm getting.
> 
> I've added this paragraph to the manual:
> 
> Note that at the moment, each access to the \type{font.fonts} or call
> to \type{font.getfont} creates a lua table for the whole font. This
> process can be quite slow. In a later version of \LUATEX, this
> interface will change (it will start using userdata objects instead of
> actual tables).

Sounds good, thanks for the clarification.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


More information about the luatex mailing list