<?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: Speeding-up builtin Matlab functions &#8211; part 1	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=speeding-up-builtin-matlab-functions-part-1</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Fri, 17 May 2019 12:00:50 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Matlabler		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-477976</link>

		<dc:creator><![CDATA[Matlabler]]></dc:creator>
		<pubDate>Fri, 17 May 2019 12:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-477976</guid>

					<description><![CDATA[Great tip, thank you! I speeded up the rangesearch function this way. I just replaced it with pdist2(X,Y,distance,&#039;RADIUS&#039;,radius); and now I save 93% of the time it takes before. So now I only need about 4 hours for my calculation, before it took over 36 hours!!

Thanks!]]></description>
			<content:encoded><![CDATA[<p>Great tip, thank you! I speeded up the rangesearch function this way. I just replaced it with pdist2(X,Y,distance,&#8217;RADIUS&#8217;,radius); and now I save 93% of the time it takes before. So now I only need about 4 hours for my calculation, before it took over 36 hours!!</p>
<p>Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Gregor Lehmiller		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424596</link>

		<dc:creator><![CDATA[Gregor Lehmiller]]></dc:creator>
		<pubDate>Wed, 02 May 2018 22:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-424596</guid>

					<description><![CDATA[Unfortunately, while it has added many features, the Matlab stats/machine-learning toolbox has been going backwards for a number of versions. In particular, the obsession with making everything a class has made code transparency and algorithm inspection a nightmare.  The related attempt to make classes have a jack-of-all-trades capability has slowed things down even more.

In our applications, we are now frequently either writing our own statistical/numerical routines (usually in C-mex) or borrowing standard algorithms.  At some point we may abandon ship to a different platform - for example, just stay in C/C++ with a Python overlay.

This has been very disappointing development in Matlab evolution, especially for those of us for which speed is critical.]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, while it has added many features, the Matlab stats/machine-learning toolbox has been going backwards for a number of versions. In particular, the obsession with making everything a class has made code transparency and algorithm inspection a nightmare.  The related attempt to make classes have a jack-of-all-trades capability has slowed things down even more.</p>
<p>In our applications, we are now frequently either writing our own statistical/numerical routines (usually in C-mex) or borrowing standard algorithms.  At some point we may abandon ship to a different platform &#8211; for example, just stay in C/C++ with a Python overlay.</p>
<p>This has been very disappointing development in Matlab evolution, especially for those of us for which speed is critical.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Michelle Hirsch		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424504</link>

		<dc:creator><![CDATA[Michelle Hirsch]]></dc:creator>
		<pubDate>Tue, 01 May 2018 16:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-424504</guid>

					<description><![CDATA[Thanks for this post, Yair. I&#039;ve passed along the issues to the development team.]]></description>
			<content:encoded><![CDATA[<p>Thanks for this post, Yair. I&#8217;ve passed along the issues to the development team.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sam Roberts		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424481</link>

		<dc:creator><![CDATA[Sam Roberts]]></dc:creator>
		<pubDate>Tue, 01 May 2018 10:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-424481</guid>

					<description><![CDATA[&#062; single-character global variables

There&#039;s really no excuse for this. Quite apart from the performance issues that you bring out, there will be newbie programmers all over the place that will be using &lt;code&gt;global a&lt;/code&gt; in their code. This is going to clobber it, they&#039;ll have no idea what happened, and it will be very hard for them to figure it out - especially if they trust MathWorks code not to do bad things like that. And if/when they do figure it out, they&#039;re going to be pretty angry with MathWorks. At the &lt;em&gt;very least&lt;/em&gt;, even if the developer felt a genuine need to use a global, they could have named the variable something like &lt;code&gt;_internal_param_a&lt;/code&gt; to reduce the likelihood of a name clash.]]></description>
			<content:encoded><![CDATA[<p>&gt; single-character global variables</p>
<p>There&#8217;s really no excuse for this. Quite apart from the performance issues that you bring out, there will be newbie programmers all over the place that will be using <code>global a</code> in their code. This is going to clobber it, they&#8217;ll have no idea what happened, and it will be very hard for them to figure it out &#8211; especially if they trust MathWorks code not to do bad things like that. And if/when they do figure it out, they&#8217;re going to be pretty angry with MathWorks. At the <em>very least</em>, even if the developer felt a genuine need to use a global, they could have named the variable something like <code>_internal_param_a</code> to reduce the likelihood of a name clash.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424421</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Mon, 30 Apr 2018 16:23:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-424421</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424420&quot;&gt;Cris Luengo&lt;/a&gt;.

@Cris - you are absolutely right that &lt;code&gt;persistent&lt;/code&gt; is better for caching than &lt;code&gt;global&lt;/code&gt; in most cases; and in the rare cases where &lt;code&gt;global&lt;/code&gt; vars are used, they should be named appropriately, with meaningful names that are longer than a single character. In the code I wrote for my client this is indeed the case - I just simplified it in this article, following the [very bad] coding conventions that the original MathWorker developer used in these functions. In hindsight this was a bad decision because it is misleading (as your comment has shown), so I have now updated the text accordingly. Thanks for pointing this out.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424420">Cris Luengo</a>.</p>
<p>@Cris &#8211; you are absolutely right that <code>persistent</code> is better for caching than <code>global</code> in most cases; and in the rare cases where <code>global</code> vars are used, they should be named appropriately, with meaningful names that are longer than a single character. In the code I wrote for my client this is indeed the case &#8211; I just simplified it in this article, following the [very bad] coding conventions that the original MathWorker developer used in these functions. In hindsight this was a bad decision because it is misleading (as your comment has shown), so I have now updated the text accordingly. Thanks for pointing this out.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Cris Luengo		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424420</link>

		<dc:creator><![CDATA[Cris Luengo]]></dc:creator>
		<pubDate>Mon, 30 Apr 2018 16:07:44 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-424420</guid>

					<description><![CDATA[`global s` and `global options`? Yes, that&#039;s not going to give any problems at all.

Why not use `persistent` to cache data?]]></description>
			<content:encoded><![CDATA[<p>`global s` and `global options`? Yes, that&#8217;s not going to give any problems at all.</p>
<p>Why not use `persistent` to cache data?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hanan Kavitz		</title>
		<link>https://undocumentedmatlab.com/articles/speeding-up-builtin-matlab-functions-part-1#comment-424394</link>

		<dc:creator><![CDATA[Hanan Kavitz]]></dc:creator>
		<pubDate>Mon, 30 Apr 2018 07:09:48 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=7509#comment-424394</guid>

					<description><![CDATA[Hi Yair,

Loved this post.
Here&#039;s another caching example I recently implemented:
It turns out we use verLessThan function alot in our code base. I discovered that some of our UI&#039;s call this function many times over and over until the UI is finally visible. It was one of the bottle necks for fast and UX friendly UI&#039;s.
Since the version of a toolbox can&#039;t just change in the middle of MATLAB process there is no need recalculating it over and over again.
I created verLessThan_fast function that caches the results of verLessThan by toolbox and version number first time this function is called and returns cached data on every consecutive call.
I got a very significant UX improvement.]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>Loved this post.<br />
Here&#8217;s another caching example I recently implemented:<br />
It turns out we use verLessThan function alot in our code base. I discovered that some of our UI&#8217;s call this function many times over and over until the UI is finally visible. It was one of the bottle necks for fast and UX friendly UI&#8217;s.<br />
Since the version of a toolbox can&#8217;t just change in the middle of MATLAB process there is no need recalculating it over and over again.<br />
I created verLessThan_fast function that caches the results of verLessThan by toolbox and version number first time this function is called and returns cached data on every consecutive call.<br />
I got a very significant UX improvement.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
