<?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: Sequences Performance Tip</title>
	<atom:link href="http://fxexperience.com/2010/07/sequences-performance-tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://fxexperience.com/2010/07/sequences-performance-tip/</link>
	<description>Sharing the Experience of JavaFX</description>
	<lastBuildDate>Mon, 21 May 2012 19:15:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Jonathan Giles</title>
		<link>http://fxexperience.com/2010/07/sequences-performance-tip/comment-page-1/#comment-8281</link>
		<dc:creator>Jonathan Giles</dc:creator>
		<pubDate>Sun, 18 Jul 2010 23:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://fxexperience.com/?p=905#comment-8281</guid>
		<description>Lichti,

Yes, if the sequence comprehension is bound, and then MAX is changed, the sequence comprehension is recomputed, which means that the loop is run again. 

In the second code snippet, this will lead to a bunch of sequences being created and then GC&#039;d. 

In the third code snippet, this will &lt;b&gt;not&lt;/b&gt; lead to massive memory consumption as only one new sequence is created.

Therefore, yes, it&#039;s avoidable if you take the advice given in this post, and use the last code snippet, rather than the second one.</description>
		<content:encoded><![CDATA[<p>Lichti,</p>
<p>Yes, if the sequence comprehension is bound, and then MAX is changed, the sequence comprehension is recomputed, which means that the loop is run again. </p>
<p>In the second code snippet, this will lead to a bunch of sequences being created and then GC&#8217;d. </p>
<p>In the third code snippet, this will <b>not</b> lead to massive memory consumption as only one new sequence is created.</p>
<p>Therefore, yes, it&#8217;s avoidable if you take the advice given in this post, and use the last code snippet, rather than the second one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lichti</title>
		<link>http://fxexperience.com/2010/07/sequences-performance-tip/comment-page-1/#comment-8272</link>
		<dc:creator>Lichti</dc:creator>
		<pubDate>Sun, 18 Jul 2010 12:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://fxexperience.com/?p=905#comment-8272</guid>
		<description>So what happens, when binding the sequence comprehension from above and then changing the MAX value?
I think a new sequence instance is created too, because trying this several times leads to massive memory consumption.
Is this avoidable somehow?</description>
		<content:encoded><![CDATA[<p>So what happens, when binding the sequence comprehension from above and then changing the MAX value?<br />
I think a new sequence instance is created too, because trying this several times leads to massive memory consumption.<br />
Is this avoidable somehow?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Giles</title>
		<link>http://fxexperience.com/2010/07/sequences-performance-tip/comment-page-1/#comment-8032</link>
		<dc:creator>Jonathan Giles</dc:creator>
		<pubDate>Fri, 09 Jul 2010 05:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://fxexperience.com/?p=905#comment-8032</guid>
		<description>Yes, this is correct. In this case a sequence is more like an ArrayList in Java, rather than an array.</description>
		<content:encoded><![CDATA[<p>Yes, this is correct. In this case a sequence is more like an ArrayList in Java, rather than an array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Lee</title>
		<link>http://fxexperience.com/2010/07/sequences-performance-tip/comment-page-1/#comment-8030</link>
		<dc:creator>Alan Lee</dc:creator>
		<pubDate>Fri, 09 Jul 2010 04:56:48 +0000</pubDate>
		<guid isPermaLink="false">http://fxexperience.com/?p=905#comment-8030</guid>
		<description>Another thing to watch out for.
Sequence is NOT an array. 
So you should not use code for array manipulation with sequences.
This is especially true in a loop where you are deleting items from a sequence, the index might not point to the itme you have in mind after an item in the middle gets deleted.</description>
		<content:encoded><![CDATA[<p>Another thing to watch out for.<br />
Sequence is NOT an array.<br />
So you should not use code for array manipulation with sequences.<br />
This is especially true in a loop where you are deleting items from a sequence, the index might not point to the itme you have in mind after an item in the middle gets deleted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PhiLho</title>
		<link>http://fxexperience.com/2010/07/sequences-performance-tip/comment-page-1/#comment-8009</link>
		<dc:creator>PhiLho</dc:creator>
		<pubDate>Thu, 08 Jul 2010 08:33:59 +0000</pubDate>
		<guid isPermaLink="false">http://fxexperience.com/?p=905#comment-8009</guid>
		<description>Yes, I often advice to use the second form of the loop, for performance reasons, and because it is a more javafxish idiom (the first form is more javaish...).
If the loop is to insert new elements continuously in an existing sequence, it is better to do it in two times: create a sequence of new items, insert the sequence in the target one. And so on.</description>
		<content:encoded><![CDATA[<p>Yes, I often advice to use the second form of the loop, for performance reasons, and because it is a more javafxish idiom (the first form is more javaish&#8230;).<br />
If the loop is to insert new elements continuously in an existing sequence, it is better to do it in two times: create a sequence of new items, insert the sequence in the target one. And so on.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

