<?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: Data structures in Java</title>
	<atom:link href="http://www.drmaciver.com/2007/08/data-structures-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.drmaciver.com/2007/08/data-structures-in-java/</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 22:56:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David R. MacIver</title>
		<link>http://www.drmaciver.com/2007/08/data-structures-in-java/#comment-25</link>
		<dc:creator>David R. MacIver</dc:creator>
		<pubDate>Sun, 05 Aug 2007 10:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=49#comment-25</guid>
		<description>Update: I&#039;ve implemented that now, and my Trie is now only twice as slow as TreeMap. :-)</description>
		<content:encoded><![CDATA[<p>Update: I&#8217;ve implemented that now, and my Trie is now only twice as slow as TreeMap. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David R. MacIver</title>
		<link>http://www.drmaciver.com/2007/08/data-structures-in-java/#comment-24</link>
		<dc:creator>David R. MacIver</dc:creator>
		<pubDate>Sun, 05 Aug 2007 09:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=49#comment-24</guid>
		<description>Ha. Yes, that it is. I think the problem is mostly not Java though, it&#039;s more that I&#039;m not yet very good at optimising things and that a naive implementation of a cunning datastructure can be less efficient than a heavily optimised version of a more normal datastructure.&lt;br/&gt;&lt;br/&gt;Thanks for the suggestion. I like the idea, but it sounds like it will only work  when the objects in question are immutable. The problem here isn&#039;t Character objects (I&#039;m storing char primitives on the nodes) but the actual nodes of the decision tree, which are mutable and thus can&#039;t be reused like that.&lt;br/&gt;&lt;br/&gt;I&#039;m going to try to solve the problem by collapsing multiple nodes into one, so that when there are long runs of characters without branches they&#039;ll be stored on a single node. This should hopefully reduce the number of objects by a very large factor (exponentially, in some cases).</description>
		<content:encoded><![CDATA[<p>Ha. Yes, that it is. I think the problem is mostly not Java though, it&#8217;s more that I&#8217;m not yet very good at optimising things and that a naive implementation of a cunning datastructure can be less efficient than a heavily optimised version of a more normal datastructure.</p>
<p>Thanks for the suggestion. I like the idea, but it sounds like it will only work  when the objects in question are immutable. The problem here isn&#8217;t Character objects (I&#8217;m storing char primitives on the nodes) but the actual nodes of the decision tree, which are mutable and thus can&#8217;t be reused like that.</p>
<p>I&#8217;m going to try to solve the problem by collapsing multiple nodes into one, so that when there are long runs of characters without branches they&#8217;ll be stored on a single node. This should hopefully reduce the number of objects by a very large factor (exponentially, in some cases).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fusiongyro</title>
		<link>http://www.drmaciver.com/2007/08/data-structures-in-java/#comment-23</link>
		<dc:creator>fusiongyro</dc:creator>
		<pubDate>Sun, 05 Aug 2007 01:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=49#comment-23</guid>
		<description>Java is usually depressing. :)&lt;br/&gt;&lt;br/&gt;I don&#039;t know much about what you&#039;re doing but you might consider using the Flyweight pattern from GoF. They talk about representing characters in a word processor as objects, but using Flyweight to, instead of creating a fresh object for each character, instead creating an object for the first instance of any given character and then just pointing back to the ones you&#039;ve already created. It should work if it&#039;s sufficient for you to point at the character objects from inside your data structure. &lt;br/&gt;&lt;br/&gt;If it can be done and you try it, it should improve both your resident size and your performance.</description>
		<content:encoded><![CDATA[<p>Java is usually depressing. :)</p>
<p>I don&#8217;t know much about what you&#8217;re doing but you might consider using the Flyweight pattern from GoF. They talk about representing characters in a word processor as objects, but using Flyweight to, instead of creating a fresh object for each character, instead creating an object for the first instance of any given character and then just pointing back to the ones you&#8217;ve already created. It should work if it&#8217;s sufficient for you to point at the character objects from inside your data structure. </p>
<p>If it can be done and you try it, it should improve both your resident size and your performance.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

