The TrisulNSM scripting API depends heavily on LuaJIT. This page records some pointers to help you write high performance scripts.
Which features are implemented in each of the major libraries are JIT-compiled http://wiki.luajit.org/NYI#libraries_base-library
The Beta version of LuaJIT 2.1.0-beta3 includes a lightweight JIT profiler. The original mailing list announcement https://www.freelists.org/post/luajit/LuaJIT-21-Profiler-released
When you download the LuaJIT source code, the profiler p.lua can be found int the
src/jit subdirectory. Simply place it in your script location.