<?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: Fast collection look-ups</title>
	<atom:link href="http://www.spartanjava.com/2009/fast-collection-look-ups/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spartanjava.com/2009/fast-collection-look-ups/</link>
	<description>Simple yet powerful Java programming</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Marcello de Sales</title>
		<link>http://www.spartanjava.com/2009/fast-collection-look-ups/comment-page-1/#comment-13579</link>
		<dc:creator>Marcello de Sales</dc:creator>
		<pubDate>Tue, 10 May 2011 05:40:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.spartanjava.com/?p=26#comment-13579</guid>
		<description>I just tested those with Java 6... Here&#039;s my results to run those tests with a larger dictionary. My requirement is load-time is not important, I will not be inserting, just looking up for words in a dictionary. TreeSet amortizes the cost of looking-up when compared to inserting all the dictionary in memory. 

            // Inserting... Took 103 ms to insert 178691 to java.util.HashSet
            // Looking-up... Took 204 ms to perform 178691 look-ups using java.util.HashSet


            // Inserting... Took 507 ms to insert 178691 to java.util.TreeSet
            // Looking-up... Took 87 ms to perform 178691 look-ups using java.util.TreeSet  &lt;&lt;-- look-up amortizes insertion

Thanks for the post
Marcello</description>
		<content:encoded><![CDATA[<p>I just tested those with Java 6&#8230; Here&#8217;s my results to run those tests with a larger dictionary. My requirement is load-time is not important, I will not be inserting, just looking up for words in a dictionary. TreeSet amortizes the cost of looking-up when compared to inserting all the dictionary in memory. </p>
<p>            // Inserting&#8230; Took 103 ms to insert 178691 to java.util.HashSet<br />
            // Looking-up&#8230; Took 204 ms to perform 178691 look-ups using java.util.HashSet</p>
<p>            // Inserting&#8230; Took 507 ms to insert 178691 to java.util.TreeSet<br />
            // Looking-up&#8230; Took 87 ms to perform 178691 look-ups using java.util.TreeSet  &lt;&lt;&#8211; look-up amortizes insertion</p>
<p>Thanks for the post<br />
Marcello</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SoulWanderer</title>
		<link>http://www.spartanjava.com/2009/fast-collection-look-ups/comment-page-1/#comment-4693</link>
		<dc:creator>SoulWanderer</dc:creator>
		<pubDate>Wed, 15 Sep 2010 09:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.spartanjava.com/?p=26#comment-4693</guid>
		<description>You are right on choosing the right collection, but if you really don&#039;t need the sorting capabilities of TreeSet, you can use HashSet.
And synchronicing them is easy, just wrap it using Collections.synchronizedSet(new HashSet(10)).

Another really important performance note is to choose the correct sorting method, for quicksort is not allways the good answer.</description>
		<content:encoded><![CDATA[<p>You are right on choosing the right collection, but if you really don&#8217;t need the sorting capabilities of TreeSet, you can use HashSet.<br />
And synchronicing them is easy, just wrap it using Collections.synchronizedSet(new HashSet(10)).</p>
<p>Another really important performance note is to choose the correct sorting method, for quicksort is not allways the good answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ricardoz</title>
		<link>http://www.spartanjava.com/2009/fast-collection-look-ups/comment-page-1/#comment-3089</link>
		<dc:creator>ricardoz</dc:creator>
		<pubDate>Thu, 04 Feb 2010 13:45:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.spartanjava.com/?p=26#comment-3089</guid>
		<description>It certainly is another option, I&#039;ll re-run the tests with it and post the results</description>
		<content:encoded><![CDATA[<p>It certainly is another option, I&#8217;ll re-run the tests with it and post the results</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ralf</title>
		<link>http://www.spartanjava.com/2009/fast-collection-look-ups/comment-page-1/#comment-3088</link>
		<dc:creator>Ralf</dc:creator>
		<pubDate>Thu, 04 Feb 2010 13:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.spartanjava.com/?p=26#comment-3088</guid>
		<description>What if using a HashSet?
http://java.sun.com/developer/JDCTechTips/2002/tt1105.html</description>
		<content:encoded><![CDATA[<p>What if using a HashSet?<br />
<a href="http://java.sun.com/developer/JDCTechTips/2002/tt1105.html" rel="nofollow">http://java.sun.com/developer/JDCTechTips/2002/tt1105.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ricardoz</title>
		<link>http://www.spartanjava.com/2009/fast-collection-look-ups/comment-page-1/#comment-2235</link>
		<dc:creator>ricardoz</dc:creator>
		<pubDate>Thu, 15 Oct 2009 13:49:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.spartanjava.com/?p=26#comment-2235</guid>
		<description>@nouseforaname: You are right about FastArrayList being targeted for multi-threaded environments, I&#039;ve removed it from the test since it doesn&#039;t contribute to the point I tried to make.

Regarding fast mode, it doesn&#039;t make a difference if you use the class from a single thread (like we are in a straight loop).

thanks for the feedback!</description>
		<content:encoded><![CDATA[<p>@nouseforaname: You are right about FastArrayList being targeted for multi-threaded environments, I&#8217;ve removed it from the test since it doesn&#8217;t contribute to the point I tried to make.</p>
<p>Regarding fast mode, it doesn&#8217;t make a difference if you use the class from a single thread (like we are in a straight loop).</p>
<p>thanks for the feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nouseforaname</title>
		<link>http://www.spartanjava.com/2009/fast-collection-look-ups/comment-page-1/#comment-2234</link>
		<dc:creator>nouseforaname</dc:creator>
		<pubDate>Thu, 15 Oct 2009 13:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.spartanjava.com/?p=26#comment-2234</guid>
		<description>You&#039;ve missed to put FastArrayList into fast mode after inserting! Read the documentation for more information. 

Also, the FastArrayList implementation is used in multithreaded environments.</description>
		<content:encoded><![CDATA[<p>You&#8217;ve missed to put FastArrayList into fast mode after inserting! Read the documentation for more information. </p>
<p>Also, the FastArrayList implementation is used in multithreaded environments.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

