As implied earlier, most of my performance tuning was done in the core engine which is C++ code. At this point, I have some gprof callstacks which look like this:
Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 16.45 1.76 1.76 luaS_newlstr 9.25 2.75 0.99 luaH_getstr 8.41 3.65 0.90 luaV_execute 6.17 4.31 0.66 luaD_precall 4.02 4.74 0.43 luaV_gettable 3.93 5.16 0.42 luaC_separateudata 3.64 5.55 0.39 index2adr 3.46 5.92 0.37 sweeplist 3.08 6.25 0.33 GCTM 2.43 6.51 0.26 lua_getfield 2.34 6.76 0.25 propagatemark 2.20 7.00 0.24 luaD_poscall 1.87 7.20 0.20 f_call 1.87 7.40 0.20 luaS_newudata 1.50 7.56 0.16 17920943 0.00 0.00 luaSet(lua_State*, LuaField const*, void*, int) 1.40 7.71 0.15 luaH_getnum
That's approximately 70% of my running time for this trace. I would really like to see where in the code all of this time is being spent, but I'm not sure what my best options are in this regard. Lua profilers I've looked at (but so far haven't been successful in actually running) don't seem nearly as polished as some of the C++ tools out there.
Currently, I'm using Lua 5.1 and just write my Lua code in emacs on a Linux system. I'm relatively new to Lua, so I could just be doing some strange things, but I'm just finding it very difficult to know where all of the time is being spent without having a profiler to tell me where to investigate. Also, any good morality guides on maintaining high performance in Lua would be appreciated.






