<?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: Preallocation performance	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/preallocation-performance/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/preallocation-performance?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=preallocation-performance</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Sun, 21 May 2017 15:00:55 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: 变量出现在每个循环迭代的大小改变-什么？ &#8211; CodingBlog		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-407086</link>

		<dc:creator><![CDATA[变量出现在每个循环迭代的大小改变-什么？ &#8211; CodingBlog]]></dc:creator>
		<pubDate>Sun, 21 May 2017 15:00:55 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-407086</guid>

					<description><![CDATA[[&#8230;] Preallocation performance [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Preallocation performance [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Array resizing in MATLAB &#124; Possibly Wrong		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-399776</link>

		<dc:creator><![CDATA[Array resizing in MATLAB &#124; Possibly Wrong]]></dc:creator>
		<pubDate>Wed, 08 Feb 2017 15:40:22 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-399776</guid>

					<description><![CDATA[[&#8230;] Pre-allocation is usually recommended as a fix: that is, size the entire array in advance, before assigning any elements.  But what if you don&#8217;t know the size of the array in advance?  Although there are several approaches to dealing with this situation, with varying complexity, the subject of this post is to describe just how much execution time may be eliminated by only a modest change to the above code. [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Pre-allocation is usually recommended as a fix: that is, size the entire array in advance, before assigning any elements.  But what if you don&#8217;t know the size of the array in advance?  Although there are several approaches to dealing with this situation, with varying complexity, the subject of this post is to describe just how much execution time may be eliminated by only a modest change to the above code. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Xiangrui Li		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-392159</link>

		<dc:creator><![CDATA[Xiangrui Li]]></dc:creator>
		<pubDate>Tue, 01 Nov 2016 14:44:43 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-392159</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/preallocation-performance#comment-359956&quot;&gt;Marshall&lt;/a&gt;.

I can replicate this version difference since 2015b. The following observation may be interesting.
If I open Windows Task Manager or Linux System Monitor to watch for memory usage, whenever the allocation (Matlab versions and zeros /end-referencing combinations) is slower, it involves increased memory usage, while the faster one does not. This suggests the faster one is using pre-allocated memory when Matlab starts. Any idea to take advantage of this? Thanks.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/preallocation-performance#comment-359956">Marshall</a>.</p>
<p>I can replicate this version difference since 2015b. The following observation may be interesting.<br />
If I open Windows Task Manager or Linux System Monitor to watch for memory usage, whenever the allocation (Matlab versions and zeros /end-referencing combinations) is slower, it involves increased memory usage, while the faster one does not. This suggests the faster one is using pre-allocated memory when Matlab starts. Any idea to take advantage of this? Thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anoush Najarian		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-360772</link>

		<dc:creator><![CDATA[Anoush Najarian]]></dc:creator>
		<pubDate>Fri, 06 Nov 2015 04:35:05 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-360772</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/preallocation-performance#comment-360031&quot;&gt;Darrell&lt;/a&gt;.

@Darrell, thank you for bringing this to our attention! 

Would it be possible for us to take a look at your code?  

Would you be open to connecting with us offline to discuss your use case?  Feel free to email Anoush dot Najarian at mathworks dot com.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/preallocation-performance#comment-360031">Darrell</a>.</p>
<p>@Darrell, thank you for bringing this to our attention! </p>
<p>Would it be possible for us to take a look at your code?  </p>
<p>Would you be open to connecting with us offline to discuss your use case?  Feel free to email Anoush dot Najarian at mathworks dot com.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Darrell		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-360031</link>

		<dc:creator><![CDATA[Darrell]]></dc:creator>
		<pubDate>Wed, 28 Oct 2015 17:52:49 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-360031</guid>

					<description><![CDATA[I just upgraded from R2015a to R2015b and a MATLAB script I have that used to consume about 2.1 GB now consumes 4.6 GB of memory.  That&#039;s a big problem for me because I used to be able to run three copies of MATLAB in parallel with different parameter settings and now I can only run one on my 8 GB, 4 processor machine.  You mentioned a new LXE above, and I&#039;m wondering if that is the culprit and if anything can be done about it.  If it&#039;s faster than the old version, that&#039;s great, but not if it uses way more memory.]]></description>
			<content:encoded><![CDATA[<p>I just upgraded from R2015a to R2015b and a MATLAB script I have that used to consume about 2.1 GB now consumes 4.6 GB of memory.  That&#8217;s a big problem for me because I used to be able to run three copies of MATLAB in parallel with different parameter settings and now I can only run one on my 8 GB, 4 processor machine.  You mentioned a new LXE above, and I&#8217;m wondering if that is the culprit and if anything can be done about it.  If it&#8217;s faster than the old version, that&#8217;s great, but not if it uses way more memory.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-359963</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 27 Oct 2015 16:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-359963</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/preallocation-performance#comment-359956&quot;&gt;Marshall&lt;/a&gt;.

@Marshall - indeed: the behavior changed in R2015b when &lt;a href=&quot;http://undocumentedmatlab.com/blog/callback-functions-performance&quot; rel=&quot;nofollow&quot;&gt;the new LXE&lt;/a&gt; (Matlab&#039;s new execution engine) replaced the previous engine.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/preallocation-performance#comment-359956">Marshall</a>.</p>
<p>@Marshall &#8211; indeed: the behavior changed in R2015b when <a href="http://undocumentedmatlab.com/blog/callback-functions-performance" rel="nofollow">the new LXE</a> (Matlab&#8217;s new execution engine) replaced the previous engine.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marshall		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-359956</link>

		<dc:creator><![CDATA[Marshall]]></dc:creator>
		<pubDate>Tue, 27 Oct 2015 15:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-359956</guid>

					<description><![CDATA[Hi Yair,

I&#039;m wondering if Mathworks have changed zeros() in the more recent revisions. I&#039;m currently seeing zeros() as being significantly faster than the end-referencing technique, for example:

&lt;pre lang=&quot;matlab&quot;&gt;
&gt;&gt; clear x; tic; x(1e4,1e4)=0; toc;
Elapsed time is 0.189022 seconds.

&gt;&gt; clear x; tic; x=zeros(1e4,1e4); toc;
Elapsed time is 0.000471 seconds.
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>I&#8217;m wondering if Mathworks have changed zeros() in the more recent revisions. I&#8217;m currently seeing zeros() as being significantly faster than the end-referencing technique, for example:</p>
<pre lang="matlab">
>> clear x; tic; x(1e4,1e4)=0; toc;
Elapsed time is 0.189022 seconds.

>> clear x; tic; x=zeros(1e4,1e4); toc;
Elapsed time is 0.000471 seconds.
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Pivot to binary matrix from categorial array - DexPage		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-353728</link>

		<dc:creator><![CDATA[Pivot to binary matrix from categorial array - DexPage]]></dc:creator>
		<pubDate>Sat, 25 Jul 2015 17:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-353728</guid>

					<description><![CDATA[[...] both these approaches use the same hacky technique to pre-allocate as listed in Undocumented MATLAB and also listed in the other answer by @rayryeng. On top of it, it uses a raw version of [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] both these approaches use the same hacky technique to pre-allocate as listed in Undocumented MATLAB and also listed in the other answer by @rayryeng. On top of it, it uses a raw version of [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Faster way to initialize arrays via empty matrix multiplication? (Matlab) - DexPage		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-353290</link>

		<dc:creator><![CDATA[Faster way to initialize arrays via empty matrix multiplication? (Matlab) - DexPage]]></dc:creator>
		<pubDate>Sat, 18 Jul 2015 16:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-353290</guid>

					<description><![CDATA[[...] doing some research, I&#8217;ve found this article in &#8220;Undocumented Matlab&#8221;, in which Mr. Yair Altman had already come to the conclusion [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] doing some research, I&#8217;ve found this article in &#8220;Undocumented Matlab&#8221;, in which Mr. Yair Altman had already come to the conclusion [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/preallocation-performance#comment-349068</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 10 May 2015 04:57:29 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2940#comment-349068</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/preallocation-performance#comment-348820&quot;&gt;hackndo&lt;/a&gt;.

Read this related post: http://undocumentedmatlab.com/blog/allocation-performance-take-2]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/preallocation-performance#comment-348820">hackndo</a>.</p>
<p>Read this related post: <a href="http://undocumentedmatlab.com/blog/allocation-performance-take-2" rel="ugc">http://undocumentedmatlab.com/blog/allocation-performance-take-2</a></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
