Performance Bottlenecks

Finding bottlenecks

If you are working on a script which is running slowly you can use the os.clock() function to help locate which part is slow. The os.clock() function returns the approximate time the cpu has been running (with millisecond accuracy), which makes it easy to see how long a piece of code is taking.

When using it in the editor you can view the times in the annotations:

For live code use iguana.logDebug() and use the debug logging level when you need to profile:

If you want more information you can always use a profiler like pepperfish.

Leave A Comment?