[Laszlo-dev] How to profile application operation

P T Withington ptw at pobox.com
Thu May 7 09:52:09 PDT 2009


Here's a hack that I wrote that waits for the instantiator to settle  
out, then profiles for a bit.  You could use this to make a profile of  
a running application use case:

   <text id="myoutput" multiline="true" />

   <handler name="oninited">
     LzTimeKernel.setTimeout(function () {
       if (lz.Instantiator.isUpdating) {
         // If the instantiator is still running, just requeue ourselves
         LzTimeKernel.setTimeout(arguments.callee, 10 * 1000);
       } else {
         // Wait a bit for things to settle
         LzTimeKernel.setTimeout(function () {
           myoutput.bringToFront();
           myoutput.format("LzIdleKernel.__callbacks: %w\n",  
LzIdleKernel.__callbacks);
           myoutput.addFormat("lz.Idle.coi: %w\n", lz.Idle.coi);
           if ($profile) {
             Profiler.stop();
             myoutput.addFormat("Starting profiling...");
             Profiler.start();
             // Profile for 40 seconds
             LzTimeKernel.setTimeout(function () {
               Profiler.stop();
               myoutput.addFormat(" done!\n");
             }, 40 * 1000);
           }
         }, 10 * 1000);
       }
     }, 10 * 1000);
   </handler>



More information about the Laszlo-dev mailing list