<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Turbocharge your string keyed hashmaps</title>
	<atom:link href="http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=turbocharge-your-string-keyed-hashmaps</link>
	<description>Dhananjay Nene's opinions on software programming, design, architecture and the internet</description>
	<lastBuildDate>Sun, 22 Jan 2012 06:53:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: David Shay</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-93</link>
		<dc:creator>David Shay</dc:creator>
		<pubDate>Mon, 28 Apr 2008 11:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-93</guid>
		<description>I have many doubts about your optimization:
1. You should NEVER use new String(String). It forces the JVM to create a new String object.
2. String literals, such as &quot;mykey&quot;, are already automatically interned by Java.
3. The call to intern is slow, since it performs a lookup in a hashtable containing ALL String literals.
4. Hashcode is already stored in String, and calculated the first time it is needed (see source code of String.java)</description>
		<content:encoded><![CDATA[<p>I have many doubts about your optimization:<br />
1. You should NEVER use new String(String). It forces the JVM to create a new String object.<br />
2. String literals, such as &#8220;mykey&#8221;, are already automatically interned by Java.<br />
3. The call to intern is slow, since it performs a lookup in a hashtable containing ALL String literals.<br />
4. Hashcode is already stored in String, and calculated the first time it is needed (see source code of String.java)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Shay</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-403</link>
		<dc:creator>David Shay</dc:creator>
		<pubDate>Mon, 28 Apr 2008 10:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-403</guid>
		<description>I have many doubts about your optimization:&lt;br&gt;1. You should NEVER use new String(String). It forces the JVM to create a new String object.&lt;br&gt;2. String literals, such as &quot;mykey&quot;, are already automatically interned by Java.&lt;br&gt;3. The call to intern is slow, since it performs a lookup in a hashtable containing ALL String literals.&lt;br&gt;4. Hashcode is already stored in String, and calculated the first time it is needed (see source code of String.java)</description>
		<content:encoded><![CDATA[<p>I have many doubts about your optimization:<br />1. You should NEVER use new String(String). It forces the JVM to create a new String object.<br />2. String literals, such as &#8220;mykey&#8221;, are already automatically interned by Java.<br />3. The call to intern is slow, since it performs a lookup in a hashtable containing ALL String literals.<br />4. Hashcode is already stored in String, and calculated the first time it is needed (see source code of String.java)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daily del.icio.us for April 20th through April 22nd &#8212; Vinny Carpenter&#8217;s blog</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-85</link>
		<dc:creator>Daily del.icio.us for April 20th through April 22nd &#8212; Vinny Carpenter&#8217;s blog</dc:creator>
		<pubDate>Tue, 22 Apr 2008 14:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-85</guid>
		<description>[...] /var/log/mind &#187; Blog Archive &#187; Turbocharge your string keyed hashmaps - In most most situations the possible universe of keys in the hashmap are known upfront either when writing the code or when starting up the application. If instead of creating hard coded strings or by using various string key parameters from say an XML fi  Tags: actionscript, adobe, air, amazon, apple, aws, blog, business, cloudcomputing, Cluster, datacenter, development, ec2, ecma, flash, flex, foss, hashmap, ide, idea, intellij, internet, iptv, iso, java, jetbrains, Linux, mac, microsoft, mxml, networking, norway, ooxml, performance, politics, programming, ria, s3, security, standards, telecom, tips, tools, UVerse, virtualization, virtualpc, vmware, Web2.0, windows, xensource [...]</description>
		<content:encoded><![CDATA[<p>[...] /var/log/mind &raquo; Blog Archive &raquo; Turbocharge your string keyed hashmaps &#8211; In most most situations the possible universe of keys in the hashmap are known upfront either when writing the code or when starting up the application. If instead of creating hard coded strings or by using various string key parameters from say an XML fi  Tags: actionscript, adobe, air, amazon, apple, aws, blog, business, cloudcomputing, Cluster, datacenter, development, ec2, ecma, flash, flex, foss, hashmap, ide, idea, intellij, internet, iptv, iso, java, jetbrains, Linux, mac, microsoft, mxml, networking, norway, ooxml, performance, politics, programming, ria, s3, security, standards, telecom, tips, tools, UVerse, virtualization, virtualpc, vmware, Web2.0, windows, xensource [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitris Andreou</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-84</link>
		<dc:creator>Dimitris Andreou</dc:creator>
		<pubDate>Mon, 21 Apr 2008 08:49:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-84</guid>
		<description>If performance is the main issue and you are creating a Symbol class anyway, consider putting the associated values directly in Symbol&#039;s fields. That will be as fast as it gets.</description>
		<content:encoded><![CDATA[<p>If performance is the main issue and you are creating a Symbol class anyway, consider putting the associated values directly in Symbol&#8217;s fields. That will be as fast as it gets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khalil</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-81</link>
		<dc:creator>Khalil</dc:creator>
		<pubDate>Thu, 17 Apr 2008 21:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-81</guid>
		<description>Calling intern can lead to permgen memory exhaustion see this bug issue on Xstream http://jira.codehaus.org/browse/XSTR-395 the fix involves using weak references to get around the cache size issue</description>
		<content:encoded><![CDATA[<p>Calling intern can lead to permgen memory exhaustion see this bug issue on Xstream <a href="http://jira.codehaus.org/browse/XSTR-395" rel="nofollow">http://jira.codehaus.org/browse/XSTR-395</a> the fix involves using weak references to get around the cache size issue</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-80</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 20:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-80</guid>
		<description>@khalil Addressed your concerns in an updated version.</description>
		<content:encoded><![CDATA[<p>@khalil Addressed your concerns in an updated version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khalil</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-402</link>
		<dc:creator>Khalil</dc:creator>
		<pubDate>Thu, 17 Apr 2008 20:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-402</guid>
		<description>Calling intern can lead to permgen memory exhaustion see this bug issue on Xstream &lt;a href=&quot;http://jira.codehaus.org/browse/XSTR-395&quot;&gt;http://jira.codehaus.org/browse/XSTR-395&lt;/a&gt; the fix involves using weak references to get around the cache size issue</description>
		<content:encoded><![CDATA[<p>Calling intern can lead to permgen memory exhaustion see this bug issue on Xstream <a href="http://jira.codehaus.org/browse/XSTR-395">http://jira.codehaus.org/browse/XSTR-395</a> the fix involves using weak references to get around the cache size issue</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khalil</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-79</link>
		<dc:creator>Khalil</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-79</guid>
		<description>Well to begin with String being mostly an immutable object computing the hashcode once seems a natural and  hashCode does cache the calculated value. The reason why fast code is indeed faster  is because the compiler interns String literals http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#intern()   
As to the static HashMap in the symbol class it is I am afraid a memory leak being a cache with no eviction strategy and one that can not be flushed, as a bonus getSymbol is not Thread safe! Static is indeed evil http://gbracha.blogspot.com/2008/02/cutting-out-static.html</description>
		<content:encoded><![CDATA[<p>Well to begin with String being mostly an immutable object computing the hashcode once seems a natural and  hashCode does cache the calculated value. The reason why fast code is indeed faster  is because the compiler interns String literals <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#intern" rel="nofollow">http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#intern</a>()<br />
As to the static HashMap in the symbol class it is I am afraid a memory leak being a cache with no eviction strategy and one that can not be flushed, as a bonus getSymbol is not Thread safe! Static is indeed evil <a href="http://gbracha.blogspot.com/2008/02/cutting-out-static.html" rel="nofollow">http://gbracha.blogspot.com/2008/02/cutting-out-static.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-401</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-401</guid>
		<description>@khalil Addressed your concerns in an updated version.</description>
		<content:encoded><![CDATA[<p>@khalil Addressed your concerns in an updated version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-78</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-78</guid>
		<description>@Dave. To correct myself, I think if String.intern() is called each time a string key is used, one should get similar results without needing a Symbol class.</description>
		<content:encoded><![CDATA[<p>@Dave. To correct myself, I think if String.intern() is called each time a string key is used, one should get similar results without needing a Symbol class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-77</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-77</guid>
		<description>@Jacob. I agree with the non-warming up and the non accounting of symbol map lookup during Symbol construction time. Here&#039;s the rationale. Actually I am not so concerned with the timings for the usual (actually I should&#039;ve called it identical). If a programmer can keep track of ensuring that the strings are identical - either explicitly or by always keeping a cached version of String.intern() result as suggested by Dave then Symbol class isn&#039;t really required. The 1% keeps on varying between slightly negative and slightly positive across different runs (basically the additional cost of lookup and the cached value of hashcode are being traded off with each other). Yes the test does not reflect the cost of creation of a symbol. But in most programs, the number of times symbol is created can be made to be much much lower than the number of times it is used for lookups.  What you suggest of as a real world example is actually not necessarily a good real world example - since it is quite feasible to ensure that the symbols get created far less often than the getter is called.</description>
		<content:encoded><![CDATA[<p>@Jacob. I agree with the non-warming up and the non accounting of symbol map lookup during Symbol construction time. Here&#8217;s the rationale. Actually I am not so concerned with the timings for the usual (actually I should&#8217;ve called it identical). If a programmer can keep track of ensuring that the strings are identical &#8211; either explicitly or by always keeping a cached version of String.intern() result as suggested by Dave then Symbol class isn&#8217;t really required. The 1% keeps on varying between slightly negative and slightly positive across different runs (basically the additional cost of lookup and the cached value of hashcode are being traded off with each other). Yes the test does not reflect the cost of creation of a symbol. But in most programs, the number of times symbol is created can be made to be much much lower than the number of times it is used for lookups.  What you suggest of as a real world example is actually not necessarily a good real world example &#8211; since it is quite feasible to ensure that the symbols get created far less often than the getter is called.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Hookom</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-76</link>
		<dc:creator>Jacob Hookom</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-76</guid>
		<description>Looking at your tests, theres a couple issues:  1) you run the &#039;usual&#039; test first without a JVM warmup-- so that 1% probably shouldn&#039;t even be there, I&#039;d even say you&#039;d hit a negative ratio there.  2) You aren&#039;t accounting for the Symbol map lookup in your tests and are using a hard reference to the symbols.  A real world example of the testSymbol would be to walk through each String key, do a Symbol.get(...) and then do the hashmap lookup.</description>
		<content:encoded><![CDATA[<p>Looking at your tests, theres a couple issues:  1) you run the &#8216;usual&#8217; test first without a JVM warmup&#8211; so that 1% probably shouldn&#8217;t even be there, I&#8217;d even say you&#8217;d hit a negative ratio there.  2) You aren&#8217;t accounting for the Symbol map lookup in your tests and are using a hard reference to the symbols.  A real world example of the testSymbol would be to walk through each String key, do a Symbol.get(&#8230;) and then do the hashmap lookup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-75</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 19:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-75</guid>
		<description>@Dave. Have updated the post with the sources to be able to verify my findings. I missed the Strings.intern() part. I think it will certainly make for a simpler Symbol implementation. However the Symbol implementation will still be required.</description>
		<content:encoded><![CDATA[<p>@Dave. Have updated the post with the sources to be able to verify my findings. I missed the Strings.intern() part. I think it will certainly make for a simpler Symbol implementation. However the Symbol implementation will still be required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khalil</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-400</link>
		<dc:creator>Khalil</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-400</guid>
		<description>Well to begin with String being mostly an immutable object computing the hashcode once seems a natural and  hashCode does cache the calculated value. The reason why fast code is indeed faster  is because the compiler interns String literals &lt;a href=&quot;http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#intern%28&quot;&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/la...&lt;/a&gt;)   &lt;br&gt;As to the static HashMap in the symbol class it is I am afraid a memory leak being a cache with no eviction strategy and one that can not be flushed, as a bonus getSymbol is not Thread safe! Static is indeed evil &lt;a href=&quot;http://gbracha.blogspot.com/2008/02/cutting-out-static.html&quot;&gt;http://gbracha.blogspot.com/2008/02/cutting-out...&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Well to begin with String being mostly an immutable object computing the hashcode once seems a natural and  hashCode does cache the calculated value. The reason why fast code is indeed faster  is because the compiler interns String literals <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#intern%28">http://java.sun.com/j2se/1.4.2/docs/api/java/la&#8230;</a>)   <br />As to the static HashMap in the symbol class it is I am afraid a memory leak being a cache with no eviction strategy and one that can not be flushed, as a bonus getSymbol is not Thread safe! Static is indeed evil <a href="http://gbracha.blogspot.com/2008/02/cutting-out-static.html">http://gbracha.blogspot.com/2008/02/cutting-out&#8230;</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-74</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-74</guid>
		<description>Doesn&#039;t String.intern() effectively do what you want?


Of course, this still seems like a pointless optimization.  In my test of doing a million puts/gets, the difference in your two approaches about 100ms, or .104 milliseconds per operation.  Not sure that would make a difference in most application contexts....</description>
		<content:encoded><![CDATA[<p>Doesn&#8217;t String.intern() effectively do what you want?</p>
<p>Of course, this still seems like a pointless optimization.  In my test of doing a million puts/gets, the difference in your two approaches about 100ms, or .104 milliseconds per operation.  Not sure that would make a difference in most application contexts&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-73</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-73</guid>
		<description>@Jacob The *another* hash lookup you mention will try to check for the identity and then equality of keys. The class Symbol is constructed such that underlying strings are always identical (even if the symbol is constructed twice using two non-identical but equal strings). This is what makes the big difference.</description>
		<content:encoded><![CDATA[<p>@Jacob The *another* hash lookup you mention will try to check for the identity and then equality of keys. The class Symbol is constructed such that underlying strings are always identical (even if the symbol is constructed twice using two non-identical but equal strings). This is what makes the big difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Hookom</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-72</link>
		<dc:creator>Jacob Hookom</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-72</guid>
		<description>How could that be faster when you are just deferring the regular String lookup to the Symbol map and then only slightly optimizing *another* hash lookup.  If you make a case to keep a hard reference to the Symbol object outside of the map, then you might as well do that for the String itself and get the same optimization.</description>
		<content:encoded><![CDATA[<p>How could that be faster when you are just deferring the regular String lookup to the Symbol map and then only slightly optimizing *another* hash lookup.  If you make a case to keep a hard reference to the Symbol object outside of the map, then you might as well do that for the String itself and get the same optimization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-399</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-399</guid>
		<description>@Dave. To correct myself, I think if String.intern() is called each time a string key is used, one should get similar results without needing a Symbol class.</description>
		<content:encoded><![CDATA[<p>@Dave. To correct myself, I think if String.intern() is called each time a string key is used, one should get similar results without needing a Symbol class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-398</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 18:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-398</guid>
		<description>@Dave. Have updated the post with the sources to be able to verify my findings. I missed the Strings.intern() part. I think it will certainly make for a simpler Symbol implementation. However the Symbol implementation will still be required.</description>
		<content:encoded><![CDATA[<p>@Dave. Have updated the post with the sources to be able to verify my findings. I missed the Strings.intern() part. I think it will certainly make for a simpler Symbol implementation. However the Symbol implementation will still be required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-397</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Thu, 17 Apr 2008 17:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-397</guid>
		<description>@Jacob The *another* hash lookup you mention will try to check for the identity and then equality of keys. The class Symbol is constructed such that underlying strings are always identical (even if the symbol is constructed twice using two non-identical but equal strings). This is what makes the big difference.</description>
		<content:encoded><![CDATA[<p>@Jacob The *another* hash lookup you mention will try to check for the identity and then equality of keys. The class Symbol is constructed such that underlying strings are always identical (even if the symbol is constructed twice using two non-identical but equal strings). This is what makes the big difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Hookom</title>
		<link>http://blog.dhananjaynene.com/2008/04/turbocharge-your-string-keyed-hashmaps/comment-page-1/#comment-396</link>
		<dc:creator>Jacob Hookom</dc:creator>
		<pubDate>Thu, 17 Apr 2008 17:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dhananjaynene.com/archives/25#comment-396</guid>
		<description>How could that be faster when you are just deferring the regular String lookup to the Symbol map and then only slightly optimizing *another* hash lookup.  If you make a case to keep a hard reference to the Symbol object outside of the map, then you might as well do that for the String itself and get the same optimization.</description>
		<content:encoded><![CDATA[<p>How could that be faster when you are just deferring the regular String lookup to the Symbol map and then only slightly optimizing *another* hash lookup.  If you make a case to keep a hard reference to the Symbol object outside of the map, then you might as well do that for the String itself and get the same optimization.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.466 seconds -->

