<?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: Implementing a simple circular buffer</title>
	<atom:link href="http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/</link>
	<description>Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.</description>
	<lastBuildDate>Tue, 21 May 2013 20:13:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Steve Eddins</title>
		<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1726</link>
		<dc:creator>Steve Eddins</dc:creator>
		<pubDate>Thu, 10 Dec 2009 16:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1726</guid>
		<description><![CDATA[Remco&#8212;I recently implemented a double-ended queue class using a circular buffer.  Because I subclassed handle, no data copies are made.  My push_front and push_back (don&#039;t remember if I actually used those names) manipulate an internal circular buffer directly.  A copy gets made only when the buffer gets full and has to be resized, but that happens in a C++ implementation as well.]]></description>
		<content:encoded><![CDATA[<p>Remco&mdash;I recently implemented a double-ended queue class using a circular buffer.  Because I subclassed handle, no data copies are made.  My push_front and push_back (don&#8217;t remember if I actually used those names) manipulate an internal circular buffer directly.  A copy gets made only when the buffer gets full and has to be resized, but that happens in a C++ implementation as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1725</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Thu, 10 Dec 2009 15:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1725</guid>
		<description><![CDATA[@Remco,

This is the kind of thing that makes an excellent MATLAB Central File Exchange entry if you are willing to share.

Thanks,
Doug]]></description>
		<content:encoded><![CDATA[<p>@Remco,</p>
<p>This is the kind of thing that makes an excellent MATLAB Central File Exchange entry if you are willing to share.</p>
<p>Thanks,<br />
Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remco</title>
		<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1724</link>
		<dc:creator>Remco</dc:creator>
		<pubDate>Thu, 10 Dec 2009 15:06:38 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1724</guid>
		<description><![CDATA[Hi All,

I am not sure if this is still relevant but yes the discussed implementation is very inefficient. I have created a buffer class in matlab because I need multiple 
circular buffers. This buffer class implements the buffer, display, and subsref functions in matlab code and the push_front and push_back functions in c code. This is because you cannot pass arguments by reference in Matlab. Matlab only makes a copy of the arguments when the arguments change inside a m file. But since you add an element to the buffer Matlab does make a copy. In a c mex implementation this does not happen and one can efficiently add a new element. Also I use a double length circular buffer to allow for linear adressing instead of circular buffer adressing]]></description>
		<content:encoded><![CDATA[<p>Hi All,</p>
<p>I am not sure if this is still relevant but yes the discussed implementation is very inefficient. I have created a buffer class in matlab because I need multiple<br />
circular buffers. This buffer class implements the buffer, display, and subsref functions in matlab code and the push_front and push_back functions in c code. This is because you cannot pass arguments by reference in Matlab. Matlab only makes a copy of the arguments when the arguments change inside a m file. But since you add an element to the buffer Matlab does make a copy. In a c mex implementation this does not happen and one can efficiently add a new element. Also I use a double length circular buffer to allow for linear adressing instead of circular buffer adressing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1433</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Mon, 11 May 2009 13:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1433</guid>
		<description><![CDATA[I profiled this with a really large amount of data, more iterations and longer buffer.  That part of the video is on the &quot;cutting room floor&quot;.  Basically, there is a negligible performance hit.  To be a real test, it would need to be done in context to see if this architecture is a problem.

This video is in keeping with one of the central themes of my programming style: &quot;Avoid premature optimization&quot;.  If I were to try and avoid the churn that this circular buffer goes through, the complexity and readability would suffer.

-Doug]]></description>
		<content:encoded><![CDATA[<p>I profiled this with a really large amount of data, more iterations and longer buffer.  That part of the video is on the &#8220;cutting room floor&#8221;.  Basically, there is a negligible performance hit.  To be a real test, it would need to be done in context to see if this architecture is a problem.</p>
<p>This video is in keeping with one of the central themes of my programming style: &#8220;Avoid premature optimization&#8221;.  If I were to try and avoid the churn that this circular buffer goes through, the complexity and readability would suffer.</p>
<p>-Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Armyr</title>
		<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1432</link>
		<dc:creator>Daniel Armyr</dc:creator>
		<pubDate>Mon, 11 May 2009 07:23:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1432</guid>
		<description><![CDATA[Like Petter, I wonder if this should be considdered an efficient implementation or only an easy one? 

I use a few rinbuffers here and there and they are all implemented like this, because it is easy. However, the line buffer = [newValue buffer(1:end-1)] gives the optimizer in me the shivers. Is that just me?]]></description>
		<content:encoded><![CDATA[<p>Like Petter, I wonder if this should be considdered an efficient implementation or only an easy one? </p>
<p>I use a few rinbuffers here and there and they are all implemented like this, because it is easy. However, the line buffer = [newValue buffer(1:end-1)] gives the optimizer in me the shivers. Is that just me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Petter</title>
		<link>http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1431</link>
		<dc:creator>Petter</dc:creator>
		<pubDate>Sat, 09 May 2009 14:22:19 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/videos/2009/05/08/implementing-a-simple-circular-buffer/#comment-1431</guid>
		<description><![CDATA[Wouldn&#039;t that solution force the entire array to be reshuffled every time a new value is added?]]></description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t that solution force the entire array to be reshuffled every time a new value is added?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
