Note: Profiler no longer works as of WoW 2.0.
Profiler is a Lua profiler for analyzing your addon code for slow spots and areas for optimization. It records the number of times a function was hit and an aggregate time of how much time has been spent in that function.
You hook the methods you want to profile with:
/profiler profile functionTable
where functionTable is a Lua table containing the functions. This is very easy if you write your Lua code like:
myFunctions = {}
function myFunctions.foo()
...
end
function myFunctions.bar()
...
end
Then you would just do:
/profiler profile myFunctions
Do some stuff, then:
/profiler report
You can download it here. Type /profiler help for help.