I think I've seen the second option more than the first outside of autogenerated wrappers, I think because instead of a table lookup you just have a constant string. LuaJIT might optimize it out but for Lua in general I believe strings are faster, although
not as friendly to autocompletion and/or linting engines.
From: lua-l-bounces@lists.lua.org <lua-l-bounces@lists.lua.org> on behalf of Marc Balmer <marc@msys.ch>
Sent: Sunday, April 7, 2019 2:00:49 AM
To: lua-l@lists.lua.org
Subject: A question of style for C module writers