ToME ships with LuaProfiler built-in, which can be used to find portions of the code that are causing lag. The profiler is incompatible with LuaJIT, so you will have to specifically compile T-Engine4 with the --lua=default option.
- Remove profiler.log from the ToME4 main folder if it exists.
- Within ToME4 press Ctrl+Alt+Shift+P to start the profiler.
- Run the code you want profiled, for example move around or use a talent.
- Press "Ctrl+Alt+Shift+P" to stop the profiler.
The profiler.log file now contains all of the calls and respective timings. You can now run it through the summary.lua program that can be found in the ToME source at src/luaprofiler/analyzer/summary.lua. From the ToME4 main folder run:
lua ./src/luaprofiler/analyzer/summary.lua profiler.log
Alternatively, zip and post profiler.log to the forums with a description of the observed lag.