<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>H1DD3N.R350URC3 &#187; Benchmark</title>
	<atom:link href="http://blog.hexagonstar.com/tag/benchmark/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hexagonstar.com</link>
	<description>&#34;Chaotic Neutral&#34;</description>
	<lastBuildDate>Wed, 03 Mar 2010 04:56:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
    <title>H1DD3N.R350URC3</title>
    <url>http://blog.hexagonstar.com/feed-logo.png</url>
    <link>http://blog.hexagonstar.com</link>
    <width>144</width>
    <height>36</height>
    <description>H1DD3N.R350URC3 - http://blog.hexagonstar.com</description>
    </image>		<item>
		<title>AS3 Short Variable/Function Names vs Long Ones</title>
		<link>http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/</link>
		<comments>http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 17:07:08 +0000</pubDate>
		<dc:creator>sascha</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/</guid>
		<description><![CDATA[In ActionScript it was common knowledge that shorter Variable and Function names yielded better performance in situations were it depends but does that still hold true for ActionScript 3.0? I&#8217;ve ran a couple of quick tests to find a clear answer about this. I usually tend keep my Variable/Function names to 1-3 characters when performance ]]></description>
			<content:encoded><![CDATA[<p>In ActionScript it was common knowledge that shorter Variable and Function names yielded better performance in situations were it depends but does that still hold true for ActionScript 3.0? I&#8217;ve ran a couple of quick tests to find a clear answer about this. I usually tend keep my Variable/Function names to 1-3 characters when performance really mattered but it might actually not be necessary. Consider the following test &#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com.hexagonstar.util.debug.Debug;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">getTimer</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> PerformanceTest extends <span style="color: #004993;">Sprite</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> aVeryVeryLongVariableNameaVeryVeryLongVariableName<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> num<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> PerformanceTest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> startTime<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span>; i <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">4000000</span>; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				aVeryVeryLongVariableNameaVeryVeryLongVariableName = <span style="color: #000000;">&#40;</span>i <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">100</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> timeTaken<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">getTimer</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">-</span> startTime <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #990000;">&quot; ms&quot;</span>;
			Debug.<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;timeTaken (long): &quot;</span> <span style="color: #000000; font-weight: bold;">+</span> timeTaken<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;ve ran this code ten times with the 50 characters long variable name and then ten times with a 3 characters long one, both in their own SWF&#8217;s. The results ranged from 757ms to 820ms, more or less the same on both sides. The sum of the long variable version was 7924ms and the one of the three characters long one was 7903ms, not much of a difference.</p>
<p>The next test was similar but this time with a 50 characters long Method name and the other again with a 3 characters long one, the Methods returned a random Number for 4000000 times during this test. The results looked similar but the total sum of each test gave a 12044ms for the long name test and 15570ms for the short named one. A noticable difference of over 3 seconds. This might have been coincidence but I&#8217;ve ran the tests a couple more times and it turned out every time that the result were very close together. This is quite interesting because I was safely believing that short names would still have an advantage. It might be time to rethink this.</p>
<img src="http://blog.hexagonstar.com/?ak_action=api_record_view&id=103&type=feed" alt="" /><br /><small>© 2006 <a href="http://blog.hexagonstar.com">H1DD3N.R350URC3</a>. | <a href="http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/">Permalink</a> | <a href="http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/#comments">6 comments</a> | Tags: <a href="http://blog.hexagonstar.com/tag/actionscript/" rel="tag">ActionScript</a>, <a href="http://blog.hexagonstar.com/tag/benchmark/" rel="tag">Benchmark</a>, <a href="http://blog.hexagonstar.com/tag/coding/" rel="tag">Coding</a>, <a href="http://blog.hexagonstar.com/tag/source-code/" rel="tag">Source Code</a> | Add to <a href="http://del.icio.us/post?url=http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/&title=AS3 Short Variable/Function Names vs Long Ones">del.icio.us</a></small>]]></content:encoded>
			<wfw:commentRss>http://blog.hexagonstar.com/as3-short-variablefunction-names-vs-long-ones/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
