{"id":69,"date":"2008-02-26T16:49:39","date_gmt":"2008-02-27T00:49:39","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=69"},"modified":"2008-02-26T16:49:39","modified_gmt":"2008-02-27T00:49:39","slug":"openlaszlo-performance-tip-pause-invisible-animations","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2008\/02\/26\/openlaszlo-performance-tip-pause-invisible-animations\/","title":{"rendered":"OpenLaszlo Performance Tip: Pause Invisible Animations"},"content":{"rendered":"<p>Over the years, I&#8217;ve looked at a number of OpenLaszlo applications that have needed performance tuning. Some performance-tuning involves significant re-writing of applications. However, I&#8217;ve also seen a number of common patterns that could be addressed by some developer guidelines on things to do, and things to avoid. So I&#8217;ve decided to publish this series of tips on OpenLaszlo performance tuning.<\/p>\n<p>This first tip, &#8220;Pause Invisible Animations&#8221; pertains to <em>runtime performance<\/em>. I&#8217;ll discuss the various areas of performance in a later post, but for now, I figured I&#8217;d start this series with a tip that most OpenLaszlo developers can implement right away.<\/p>\n<p>In OpenLaszlo, developers frequently use animated SWF resources in your applications (e.g. for loading indicators). These SWFs may take the form of a spinning wheel, an hourglass etc. When it&#8217;s no longer needed, you might disable the loading indicator by making it invisible. If you make an animated SWF invisible, but don&#8217;t stop it, then it will continue to consume client CPU while the animation is in progress. One animated SWF won&#8217;t slow an application significantly, but a number of animations that are running could account for a few percentage-points of CPU.<\/p>\n<p>Fixing the problem is easy: just call stop() on the relevant views before making them invisible. There&#8217;s no reason <em>not<\/em> to stop invisible animations.<\/p>\n<p>Determining whether you have animations you can&#8217;t see is also relatively easy. First, you&#8217;ll need the <a href=\"http:\/\/www.adobe.com\/support\/flashplayer\/downloads.html\" target=\"_blank\"><em>Debugger Version<\/em> of the Flash Player<\/a>. This is a browser-plugin, just like the standard Flash Player, and once installed, it will replace the existing player. The debugger player includes an option in the right-click menu to &#8220;Show Redraw Regions&#8221;. This feature visually identifies which parts of your application are actively getting redrawn (thereby consuming CPU), by highlighting them in red.<\/p>\n<p>I tested this on the current version of <a href=\"http:\/\/www.laszlosystems.com\/products\/webtop\/overview\" target=\"_blank\">Laszlo Webtop<\/a>, (which you can try on <a href=\"http:\/\/www.gowebtop.com\/\" target=\"_blank\">www.gowebtop.com<\/a>) and noticed a few animations that could easily be removed:<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/www.gowebtop.com\/\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2008\/02\/show_redraw.jpg\" alt=\"Redraw Regions on gowebtop.com\" \/><\/a><\/p>\n<p>Stopping these animations will reduce CPU load while the application is being used, allowing important actions to execute a little faster.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Over the years, I&#8217;ve looked at a number of OpenLaszlo applications that have needed performance tuning. Some performance-tuning involves significant re-writing of applications. However, I&#8217;ve also seen a number of common patterns that could be addressed by some developer guidelines on things to do, and things to avoid. So I&#8217;ve decided to publish this series &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2008\/02\/26\/openlaszlo-performance-tip-pause-invisible-animations\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">OpenLaszlo Performance Tip: Pause Invisible Animations<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/69"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":0,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}