Performance Analysis

Delays and lag are significant issues to be considered when developing scripts for the Second Life world. As a result scripters must pay careful attention to execution times for processing intensive activities or algorithms.

To address this need, the Performance Analysis feature* allows you to identify model components to be monitored and for which execution time statistics will be gathered and output.

STATS>> *** PERFORMANCE STATS ***          Count   Tot Time  Avg Time
[09:14] Object: STATS>> EVENT_listen:               3      2.940365  0.980122
[09:14] Object: STATS>> EVENT_sensor:              0      0.000000  0.000000
[09:14] Object: STATS>> EVENT_timer:               8      0.719490  0.089936
[09:14] Object: STATS>> EVENT_touch_end:      2      0.789647  0.394824

Each model component type can be configured to monitor either all usages (e.g., monitor all States in the model) or only particular instances of that type.

For monitored components you can select to output the number of times a component's code has been executed, it's cumulative execution time and it's average execution time.

The following example shows how performance measurements can be gathered for a particular section of LSL code within a script model by using MiceOnABeam's compiler directives.

integer element;
integer len = llGetListLength(vectorList);
#stats // Measure execution time starting from this point.

for (element = 0; element<len; element++)
{
     TRACE_VEC("V"+(string)element,(string)gTranslate(llList2Vector(vectorList,element)));
}
#endstats // Measure execution time till this point.

MSGOUT("Done");
#if debug
REPORT_PERFORMANCE();
#endif

 

* The Performance Analysis feature is only available with the Professional version of
   MiceOnABeam.