<?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: Adding Concurrency Optimization in Silverlight 3</title>
	<atom:link href="http://blog.efvincent.com/concurrency-optimization-silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.efvincent.com/concurrency-optimization-silverlight/</link>
	<description>Development, mostly .NET... but anything cool</description>
	<lastBuildDate>Mon, 09 Jan 2012 22:28:48 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: EFVincent</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-19</link>
		<dc:creator>EFVincent</dc:creator>
		<pubDate>Thu, 10 Dec 2009 19:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-19</guid>
		<description>Ole Jak - On my quad core Dell, the Alchemy link you forwarded gets to about 31 FPS. If I set the Silverlight multithreaded version to one thread, it also achieves about 31 FPS. However setting the SL version to 8 threads on a quad core box yields about 65 FPS. Alchemy does seem to speed up rendering, but still isn&#039;t doing parallel calculations over multi-cores, which is what this experiment is about.

Even on my MacBook Pro, a dual core box, setting the Silverlight version to 4 threads yields about 45 FPS. Clearly the multithreading code has a very significant impact on computationally intensive applications where data parallelism is possible.

Sidebar: Since the original posting I&#039;m now running SL4 Beta 1, and performance of this application is consistent with SL3 release.</description>
		<content:encoded><![CDATA[<p>Ole Jak &#8211; On my quad core Dell, the Alchemy link you forwarded gets to about 31 FPS. If I set the Silverlight multithreaded version to one thread, it also achieves about 31 FPS. However setting the SL version to 8 threads on a quad core box yields about 65 FPS. Alchemy does seem to speed up rendering, but still isn&#8217;t doing parallel calculations over multi-cores, which is what this experiment is about.</p>
<p>Even on my MacBook Pro, a dual core box, setting the Silverlight version to 4 threads yields about 45 FPS. Clearly the multithreading code has a very significant impact on computationally intensive applications where data parallelism is possible.</p>
<p>Sidebar: Since the original posting I&#8217;m now running SL4 Beta 1, and performance of this application is consistent with SL3 release.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ole Jak</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-18</link>
		<dc:creator>Ole Jak</dc:creator>
		<pubDate>Mon, 05 Oct 2009 19:57:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-18</guid>
		<description>Great! But  it seems to me that Alchymy is FASTER or at least same speed))) http://www.unitzeroone.com/labs/alchemyPushingPixels/</description>
		<content:encoded><![CDATA[<p>Great! But  it seems to me that Alchymy is FASTER or at least same speed))) <a href="http://www.unitzeroone.com/labs/alchemyPushingPixels/" rel="nofollow">http://www.unitzeroone.com/labs/alchemyPushingPixels/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaspar Lüthi</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-14</link>
		<dc:creator>Kaspar Lüthi</dc:creator>
		<pubDate>Sun, 23 Aug 2009 18:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-14</guid>
		<description>When having &quot;twirl&quot; open with 4 windows, the CPU is used between 1-3%. As I said, just try it yourself.

In this SL3 Quake demo, the frame rate is not affected by AIR apps: http://www.innoveware.com/ql3/QuakeLight.html</description>
		<content:encoded><![CDATA[<p>When having &#8220;twirl&#8221; open with 4 windows, the CPU is used between 1-3%. As I said, just try it yourself.</p>
<p>In this SL3 Quake demo, the frame rate is not affected by AIR apps: <a href="http://www.innoveware.com/ql3/QuakeLight.html" rel="nofollow">http://www.innoveware.com/ql3/QuakeLight.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-13</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Sun, 23 Aug 2009 03:53:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-13</guid>
		<description>Amazing article and a very interesting read.</description>
		<content:encoded><![CDATA[<p>Amazing article and a very interesting read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EFVincent</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-12</link>
		<dc:creator>EFVincent</dc:creator>
		<pubDate>Thu, 20 Aug 2009 12:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-12</guid>
		<description>Kaspar - interesting about Air causing other apps to slow down when running certain apps. It would be interesting also to profile your system while those other apps are running. What demands are on the CPU, memory, graphics sub-system, etc. at that time? Are any other applications effected?

Something like the strange attractor application is going to be particularly sensitive to CPU contention. Not many apps are so completely CPU bound. Things like 3D renderers, programs that encode music or video, operations like HDR Merge in Photoshop, those things are sensitive to CPU contention that might not be noticed surfing the web or writing email.</description>
		<content:encoded><![CDATA[<p>Kaspar &#8211; interesting about Air causing other apps to slow down when running certain apps. It would be interesting also to profile your system while those other apps are running. What demands are on the CPU, memory, graphics sub-system, etc. at that time? Are any other applications effected?</p>
<p>Something like the strange attractor application is going to be particularly sensitive to CPU contention. Not many apps are so completely CPU bound. Things like 3D renderers, programs that encode music or video, operations like HDR Merge in Photoshop, those things are sensitive to CPU contention that might not be noticed surfing the web or writing email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaspar Lüthi</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-11</link>
		<dc:creator>Kaspar Lüthi</dc:creator>
		<pubDate>Thu, 20 Aug 2009 09:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-11</guid>
		<description>&quot;The (SL3) plugin is like a parasite, it lives off the browser&quot; - and off the Flash community...just kidding :)

Back with some news. Accidentally I discovered how to reproduce the slowdown. It&#039;s when I have certain Adobe AIR applications running with visible windows, the concurrent SL3 version significantly slows down. When the AIR app is minimized or terminated, speed is back to normal. &quot;Naive&quot; SL3 version seems to be always OK.

You can eventually try It yourself, one of the AIR apps slowing things down is &quot;thwirl&quot;, a Twitter client, try multiple open account windows. Also the Times Reader slowed it down. Another app, Balsamiq, did not slow it down. It eventually depends how the app authored.

I have AIR 1.5.2 installed. Interestingly the slowdown affects both FF and IE, so this is not a browser issue.</description>
		<content:encoded><![CDATA[<p>&#8220;The (SL3) plugin is like a parasite, it lives off the browser&#8221; &#8211; and off the Flash community&#8230;just kidding <img src='http://blog.efvincent.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Back with some news. Accidentally I discovered how to reproduce the slowdown. It&#8217;s when I have certain Adobe AIR applications running with visible windows, the concurrent SL3 version significantly slows down. When the AIR app is minimized or terminated, speed is back to normal. &#8220;Naive&#8221; SL3 version seems to be always OK.</p>
<p>You can eventually try It yourself, one of the AIR apps slowing things down is &#8220;thwirl&#8221;, a Twitter client, try multiple open account windows. Also the Times Reader slowed it down. Another app, Balsamiq, did not slow it down. It eventually depends how the app authored.</p>
<p>I have AIR 1.5.2 installed. Interestingly the slowdown affects both FF and IE, so this is not a browser issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OJ</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-10</link>
		<dc:creator>OJ</dc:creator>
		<pubDate>Wed, 19 Aug 2009 22:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-10</guid>
		<description>Aloha!

You&#039;re right, I didn&#039;t read the code thoroughly :) Nor did I read the previous comments thoroughly. That&#039;ll teach me eh? It appears you are doing everything that I had mentioned, and your comments re: the browser are indeed appropriate.

Next time, I promise to make sure i read things properly before stating stuff that&#039;s already been done!

Cheers!
OJ</description>
		<content:encoded><![CDATA[<p>Aloha!</p>
<p>You&#8217;re right, I didn&#8217;t read the code thoroughly <img src='http://blog.efvincent.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Nor did I read the previous comments thoroughly. That&#8217;ll teach me eh? It appears you are doing everything that I had mentioned, and your comments re: the browser are indeed appropriate.</p>
<p>Next time, I promise to make sure i read things properly before stating stuff that&#8217;s already been done!</p>
<p>Cheers!<br />
OJ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EFVincent</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-9</link>
		<dc:creator>EFVincent</dc:creator>
		<pubDate>Wed, 19 Aug 2009 13:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-9</guid>
		<description>OJ - 

I not sure you looked at the code carefully enough; if there were 90,000 work items, we&#039;d be talking about frames per minute or hour not frames per second! 

If you review the &lt;code&gt;ParallelFor()&lt;/code&gt; method you&#039;ll see that the pixels are indeed being divided between the threads, and there are the same number of AutoResetEvents as the number of threads.

The number of threads is dictated by the last parameter of the &lt;code&gt;ParallelFor()&lt;/code&gt; function, which is driven by the value of the slider. The best performance comes from roughly 2x the number of cores, or &lt;strong&gt;4 threads&lt;/strong&gt; on a typical dual core box, and 8 from a quad core box. 

Setting the number of threads to the number of cores exactly doesn&#039;t produce the best possible frame rate. Slightly higher is better, the renderer will achieve the best balance of favorable scheduling of its threads and the penalty of context switching.

The slider allows you to split the work up into as many as 64 threads, which does indeed bring the frame rate down. The point is to show the effect of attempting to use too high a degree of parallelism.

With regards to the blaming of the browser - Kaspar experienced significantly different behavior running the same component in his particular environment with two different browsers. The browser version was the only (apparent) variable between the two different sets of behavior, which would make it an excellent suspect when investigating the difference in behavior. It would be prudent for Silverlight, (and Flash) developers to understand that there is a relationship between the plugin and the browser, and what the potential impact of that relationship is.

Thanks for the comment!
-e</description>
		<content:encoded><![CDATA[<p>OJ &#8211; </p>
<p>I not sure you looked at the code carefully enough; if there were 90,000 work items, we&#8217;d be talking about frames per minute or hour not frames per second! </p>
<p>If you review the <code>ParallelFor()</code> method you&#8217;ll see that the pixels are indeed being divided between the threads, and there are the same number of AutoResetEvents as the number of threads.</p>
<p>The number of threads is dictated by the last parameter of the <code>ParallelFor()</code> function, which is driven by the value of the slider. The best performance comes from roughly 2x the number of cores, or <strong>4 threads</strong> on a typical dual core box, and 8 from a quad core box. </p>
<p>Setting the number of threads to the number of cores exactly doesn&#8217;t produce the best possible frame rate. Slightly higher is better, the renderer will achieve the best balance of favorable scheduling of its threads and the penalty of context switching.</p>
<p>The slider allows you to split the work up into as many as 64 threads, which does indeed bring the frame rate down. The point is to show the effect of attempting to use too high a degree of parallelism.</p>
<p>With regards to the blaming of the browser &#8211; Kaspar experienced significantly different behavior running the same component in his particular environment with two different browsers. The browser version was the only (apparent) variable between the two different sets of behavior, which would make it an excellent suspect when investigating the difference in behavior. It would be prudent for Silverlight, (and Flash) developers to understand that there is a relationship between the plugin and the browser, and what the potential impact of that relationship is.</p>
<p>Thanks for the comment!<br />
-e</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-8</link>
		<dc:creator>Jerry</dc:creator>
		<pubDate>Wed, 19 Aug 2009 12:24:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-8</guid>
		<description>Great post Eric! 

Fun examples with great commentary and working source are always good in my book :-)

Silverlight, Concurrency, Functional Programming, Generics - all cool...</description>
		<content:encoded><![CDATA[<p>Great post Eric! </p>
<p>Fun examples with great commentary and working source are always good in my book <img src='http://blog.efvincent.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Silverlight, Concurrency, Functional Programming, Generics &#8211; all cool&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OJ</title>
		<link>http://blog.efvincent.com/concurrency-optimization-silverlight/comment-page-1/#comment-7</link>
		<dc:creator>OJ</dc:creator>
		<pubDate>Wed, 19 Aug 2009 09:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.efvincent.com/?p=24#comment-7</guid>
		<description>It&#039;s not a surprise that you&#039;ve slowed down the application given the number of work items you&#039;re queuing and the number of events you&#039;re waiting on. If you&#039;ve got a resolution of 300 x 300 (which you don&#039;t, you have more) that&#039;s 90,000 work items. The context switching and waiting would send performance through the floor.

You&#039;d be better off dividing your pixel set by the number of physical hardware threads you have on your machine, and getting each one of those threads to work on a subset of the info. You don&#039;t have to worry about contention if you force each work item to deal with its own stuff. Your overheads would drop substantially and you&#039;d probably see at least some kind of performance improvement.

I wouldn&#039;t blame the browser or the plugin. Too much multithreading is often worse than none!

Just my $0.02 :) Good luck!
OJ</description>
		<content:encoded><![CDATA[<p>It&#8217;s not a surprise that you&#8217;ve slowed down the application given the number of work items you&#8217;re queuing and the number of events you&#8217;re waiting on. If you&#8217;ve got a resolution of 300 x 300 (which you don&#8217;t, you have more) that&#8217;s 90,000 work items. The context switching and waiting would send performance through the floor.</p>
<p>You&#8217;d be better off dividing your pixel set by the number of physical hardware threads you have on your machine, and getting each one of those threads to work on a subset of the info. You don&#8217;t have to worry about contention if you force each work item to deal with its own stuff. Your overheads would drop substantially and you&#8217;d probably see at least some kind of performance improvement.</p>
<p>I wouldn&#8217;t blame the browser or the plugin. Too much multithreading is often worse than none!</p>
<p>Just my $0.02 <img src='http://blog.efvincent.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Good luck!<br />
OJ</p>
]]></content:encoded>
	</item>
</channel>
</rss>

