lua-users home
lua-l archive

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


Am 05.12.2013 00:04 schröbte Marc Lepage:
Ah, luaL_checkoption, I knew I had seen that somewhere.

I see it used here:
http://www.lua.org/source/5.1/lbaselib.c.html#luaB_collectgarbage

I can see it's fairly convenient. However in this case, collectgarbage
probably isn't (or at least shouldn't) be called a lot. For functions that
are called a lot, would it be more efficient to pre-create the table of
strings/values for lookup?

Quite possibly, but there's only one way to find out ...
You might also be interested in this[1] thread.

  [1]: http://lua-users.org/lists/lua-l/2012-01/msg00396.html


Philipp