[Dev-luatex] Dump sharing - redundant copying/allocations

Michal Vlasák lahcim8 at gmail.com
Wed Jul 21 16:08:15 CEST 2021

On Wed Jul 21, 2021 at 3:57 PM CEST, Hans Hagen wrote:
> even if one would handle bytes in the lua bytecode, the bytecode itself
> is not portable (and i'm not even sure how luajit stuff fits in because
> luajit is even more platform specific

LuaJIT is actually really nice in this regard:

    "The generated bytecode is portable and can be loaded on any
    architecture that LuaJIT supports, independent of word size or
    endianess. However the bytecode compatibility versions must match."

> one observation is that using macros instead of functions for
> performance makes little sense in a program like tex where one jumps
> over memory space all the time (compilers are quite okay in optimizing),
> but there can be differences between versions of e.g. gcc

I think that modern compilers are good with inlining, one can get more
espcially when functions are marked static. So I incline towards
functions rather than macros.

> in general, loss of performance in a tex engine is more due to the way
> macros are composed (or user styles for that matter)
> another one is the performance of the console, i.e. kind of font,
> buffer, refresh delays defaults (i noticed that linux has large delays
> so that's the fastest, the new windows terminal is also fast) .. now
> that one is really measureable .. just try to run with piping the log
> to a file (all understandable) .. squeezing microseconds out of the
> binary can easily be nilled that way

Yeah, you are right, even for 18 lines of console output I mesaure more
noticable difference than with the mallocs and byte swapping.



More information about the dev-luatex mailing list