lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The function luaS_newlstr showed up on the profiler
in a significant way, so I decided to investigate what strings are being
created in our game. To my great surprise, it turned out that
nearly 70% of the calls to this function are for the string "line" and
come from the debug hook function (hookf in ldblib.c) which calls our
own hook function and uses the string "line" to indicate which of the
event types has occured.

Is it possible for these strings used for debug events to be pre-allocated
in some way, similar to how the metatable predefined keys are
preallocated in luaT_init?

Best regards,
Assen