<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="2.0" xml:base="http://www.connectedpixel.com/blog">
<channel>
 <title>connectedpixel.com - Performance</title>
 <link>http://www.connectedpixel.com/blog/taxonomy/term/6/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>AS2: Static vs. Instance vs. Setter Funcs</title>
 <link>http://www.connectedpixel.com/blog/performance/impact/functypes</link>
 <description>&lt;p&gt;Flash has several ways to define a function:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Class methods&lt;/li&gt;
&lt;li&gt;Setter/getter methods&lt;/li&gt;
&lt;li&gt;Static class methods&lt;/li&gt;
&lt;li&gt;Local functions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I wrote equivalent functions in each form and compared their performance.  The raw data is down below in the appendix.  I&#039;ll go over the results here that I find surprising:&lt;/p&gt;

&lt;div class=&quot;subentry&quot;&gt;
&lt;h3&gt;Setter/Getters vs. Regular Instance Functions&lt;/h3&gt;
&lt;pre&gt;
// Setter/Getter
p.XVal = 23.4;        // 25 msec / 1000
x = p.XVal;           // 12 msec / 1000
&lt;/pre&gt;
&lt;p align=&quot;center&quot;&gt;vs.&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;</description>
 <category domain="http://www.connectedpixel.com/blog/taxonomy/term/6">Performance</category>
 <category domain="http://www.connectedpixel.com/blog/taxonomy/term/21">ActionScript</category>
 <pubDate>Fri, 11 Apr 2008 18:48:43 -0700</pubDate>
</item>
<item>
 <title>AS2: Performance Impact of OO Coding Style</title>
 <link>http://www.connectedpixel.com/blog/performance/impact/oo</link>
 <description>&lt;p&gt;While writing that animated sine-wave thingy at the top of my web site, I ran into a problem -- my frame rate was terrible.  I was getting maybe 3 or 4 frames a second.  My browser was bogging down, my computer was bogging down.  I had to either speed it up, or I had to dump it.&lt;/p&gt;
&lt;p&gt;As it has many trig calculations in each frame, I thought that Math.sin() was to blame.  I was getting ready to write a table-lookup algorithm to replace Math.sin, when the little angel on my shoulder told me to quit guessing and be more scientific about it.  So I wrote a test program instead. I found that Math.sin was extremely fast and certainly not the cause of my problem.&lt;/p&gt;</description>
 <category domain="http://www.connectedpixel.com/blog/taxonomy/term/6">Performance</category>
 <category domain="http://www.connectedpixel.com/blog/taxonomy/term/21">ActionScript</category>
 <pubDate>Fri, 11 Apr 2008 18:49:06 -0700</pubDate>
</item>
</channel>
</rss>
