Added some profiling to LUA function dispatcher