lua-users home
lua-l archive

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

Tom Spilman wrote:
    Quick optimization question:  Does Lua skip calling empty functions?

No, I don't believe so -- since 'everything' is dynamic, it
can't know that a function is empty until the moment it's
called.  (It'd probably be feasible for Lua to inline functions
and turn your empty function calls into no-ops ahead of time if
your functions were 'local' and Lua had the notion of constant
objects, but it doesn't.)

Adam D. Moss   . ,,^^   co:3
"When I was young, I would break down and cry whenever mom made me
throw an empty toilet paper tube in the trash can. I just imagined
it sitting at the dump, all cardboard and sad." -- T.Farnon