Blog | Crank Software

Timing and Tracing Lua

Written by Thomas Fletcher | Jun 9, 2010 2:40:36 PM

Lua is the primary scripting language for Storyboard applications. One of the exciting features that has been added to as part of the Storyboard 1.1 release is the addition of an integrated Lua debugger ... and we've got a short video coming up later this week that will show you exactly how to use this debugger during your application simulations.

Sometimes you just want to get a bit of insight into how the application is running, where the time is being spent and to validate that the code paths you believe are being taken ... well that they really are being executed.  Lua makes this type of tooling exceptionally easy by exposing a tidy set of debugging and introspection API's.

I've just posted a small example in the Crank community forums that provides both a console function stack trace and some function level timing information.

The great thing with this example is that it can just be dropped into any existing design and you can start getting timing details about how your scripts are performing.  I plan on doing a few updates to this script to add in some extra capabilities for function time aggregation and potentially call stack timings.  In the meantime if you've got a lot of Lua script you are looking at, it might be a handy tool to get a quick execution overview.

Thomas