<?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: Performance</title>
	<atom:link href="http://schani.wordpress.com/2007/06/29/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://schani.wordpress.com/2007/06/29/performance/</link>
	<description>and little else</description>
	<pubDate>Tue, 14 Oct 2008 13:53:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: tihopilik</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6549</link>
		<dc:creator>tihopilik</dc:creator>
		<pubDate>Mon, 09 Jul 2007 08:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6549</guid>
		<description>Hi 
 
I can't be bothered with anything these days, but shrug. I just don't have anything to say recently. 
 
 
G'night</description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>I can&#8217;t be bothered with anything these days, but shrug. I just don&#8217;t have anything to say recently. </p>
<p>G&#8217;night</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: schani</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6189</link>
		<dc:creator>schani</dc:creator>
		<pubDate>Mon, 02 Jul 2007 07:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6189</guid>
		<description>Thanks for all the helpful comments Itai and everybody else!  As soon as I have time again I'll try to improve my C# version of the image processing and put it into the application.</description>
		<content:encoded><![CDATA[<p>Thanks for all the helpful comments Itai and everybody else!  As soon as I have time again I&#8217;ll try to improve my C# version of the image processing and put it into the application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Itai Bar-Haim</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6173</link>
		<dc:creator>Itai Bar-Haim</dc:creator>
		<pubDate>Sun, 01 Jul 2007 21:01:40 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6173</guid>
		<description>Hi again, sorry for the separate post, just wanted to share my results.
The overall gain on my computer for a 4MP photo (2304x1728) is about 15% (from 64.8125 seconds to 56.53125 seconds), using the techniques I described in my two posts above.

Itai.</description>
		<content:encoded><![CDATA[<p>Hi again, sorry for the separate post, just wanted to share my results.<br />
The overall gain on my computer for a 4MP photo (2304&#215;1728) is about 15% (from 64.8125 seconds to 56.53125 seconds), using the techniques I described in my two posts above.</p>
<p>Itai.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Itai Bar-Haim</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6172</link>
		<dc:creator>Itai Bar-Haim</dc:creator>
		<pubDate>Sun, 01 Jul 2007 20:53:08 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6172</guid>
		<description>I managed to reduce time by (1) eliminating the helper-counters rowIndex and rowMaskIndex, and instead of recalculating index and maskIndex each loop, I just add 3 to index and 1 to maskIndex at the end of the most inner loop. Works great with what I suggested in my previous post. In addition, I eliminated the ir, ig and ib variables and placed the inData access directly in the sgray computation line.
In the outData lines, I put the last part of each line (which is the same in all lines) in a variable, and used it instead. In addition, this line is using (65535 - inverted), which is actually *contrasted*, so just used it instead (resulted in a noticeable gain).
I converted the layers loop to a foreach loop. didn't help, didn't hurt anything, and looks nicer.
I placed the declaration of sgray outside the loops (only the 'int sgray;'). It helped a bit.

Hope this helps.
Itai.</description>
		<content:encoded><![CDATA[<p>I managed to reduce time by (1) eliminating the helper-counters rowIndex and rowMaskIndex, and instead of recalculating index and maskIndex each loop, I just add 3 to index and 1 to maskIndex at the end of the most inner loop. Works great with what I suggested in my previous post. In addition, I eliminated the ir, ig and ib variables and placed the inData access directly in the sgray computation line.<br />
In the outData lines, I put the last part of each line (which is the same in all lines) in a variable, and used it instead. In addition, this line is using (65535 - inverted), which is actually *contrasted*, so just used it instead (resulted in a noticeable gain).<br />
I converted the layers loop to a foreach loop. didn&#8217;t help, didn&#8217;t hurt anything, and looks nicer.<br />
I placed the declaration of sgray outside the loops (only the &#8216;int sgray;&#8217;). It helped a bit.</p>
<p>Hope this helps.<br />
Itai.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Itai Bar-Haim</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6163</link>
		<dc:creator>Itai Bar-Haim</dc:creator>
		<pubDate>Sun, 01 Jul 2007 19:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6163</guid>
		<description>It seemed I got some increase in speed when I didn't perform arithmetics to define index position in the array. Instead I accessed inData directly with index, putting the ib first, then performed ++index while accessing inData for ig, then again for ir, and the opposite order for outData. Optimizations where on, unsafe code allowed and used (wrapping the inData and outData access parts). My system is really old and slow (P4 1.7gh, 512MB ram)

Hope it helps a bit.
Itai.</description>
		<content:encoded><![CDATA[<p>It seemed I got some increase in speed when I didn&#8217;t perform arithmetics to define index position in the array. Instead I accessed inData directly with index, putting the ib first, then performed ++index while accessing inData for ig, then again for ir, and the opposite order for outData. Optimizations where on, unsafe code allowed and used (wrapping the inData and outData access parts). My system is really old and slow (P4 1.7gh, 512MB ram)</p>
<p>Hope it helps a bit.<br />
Itai.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thefoxisonfire</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6148</link>
		<dc:creator>thefoxisonfire</dc:creator>
		<pubDate>Sun, 01 Jul 2007 13:30:20 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6148</guid>
		<description>Ok that is understandable, however then you still only need 2 copies (8 bit source and 16 bit working copy).

You have:
1 copy (new Bitmap)
1 copy (values array)
1 copy (inData array * 2)
1 copy (outData array * 2)
1 copy (newValues array * 2)
and you would have
1 copy more if you didn't overwrite your sourceimage in the end
and
2 copys (masks, did not count these anyways, are per pixel, not per color)

If you load a single 16 Megapixel photo you app needs about 400MB RAM just for data.

You could make the app about 10 times faster than it is now. There are more than enough suggestions in your comments. If you don't want to nobody is going to force you ;)</description>
		<content:encoded><![CDATA[<p>Ok that is understandable, however then you still only need 2 copies (8 bit source and 16 bit working copy).</p>
<p>You have:<br />
1 copy (new Bitmap)<br />
1 copy (values array)<br />
1 copy (inData array * 2)<br />
1 copy (outData array * 2)<br />
1 copy (newValues array * 2)<br />
and you would have<br />
1 copy more if you didn&#8217;t overwrite your sourceimage in the end<br />
and<br />
2 copys (masks, did not count these anyways, are per pixel, not per color)</p>
<p>If you load a single 16 Megapixel photo you app needs about 400MB RAM just for data.</p>
<p>You could make the app about 10 times faster than it is now. There are more than enough suggestions in your comments. If you don&#8217;t want to nobody is going to force you ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: schani</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6138</link>
		<dc:creator>schani</dc:creator>
		<pubDate>Sun, 01 Jul 2007 07:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6138</guid>
		<description>Well, the point is to do 16 bit processing from start to finish, i.e. to be able to process 16 bit source images and save the result as 16 bit images, so I don't want to have anything to do with 8 bit images in my processing core.  I'm loading the 8 bit image simply to have some image to work on.

And I don't think that I hold each pixel 6 times.</description>
		<content:encoded><![CDATA[<p>Well, the point is to do 16 bit processing from start to finish, i.e. to be able to process 16 bit source images and save the result as 16 bit images, so I don&#8217;t want to have anything to do with 8 bit images in my processing core.  I&#8217;m loading the 8 bit image simply to have some image to work on.</p>
<p>And I don&#8217;t think that I hold each pixel 6 times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thefoxisonfire</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6111</link>
		<dc:creator>thefoxisonfire</dc:creator>
		<pubDate>Sat, 30 Jun 2007 21:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6111</guid>
		<description>I've seen that. But it seems to me that you only do per-pixel processing so there is no need to keep the entire dataset but only the data for a single pixel. And in fact you hold each pixel multiple (6?) times.
The library I mentioned does most calculations in double precision, however as soon as the data is saved out its still only a 32bpp image (8bits per channel).</description>
		<content:encoded><![CDATA[<p>I&#8217;ve seen that. But it seems to me that you only do per-pixel processing so there is no need to keep the entire dataset but only the data for a single pixel. And in fact you hold each pixel multiple (6?) times.<br />
The library I mentioned does most calculations in double precision, however as soon as the data is saved out its still only a 32bpp image (8bits per channel).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: schani</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6100</link>
		<dc:creator>schani</dc:creator>
		<pubDate>Sat, 30 Jun 2007 18:48:19 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6100</guid>
		<description>I'm reading the data in as 3x8 bit but I'm converting it to 3x16 bit because I want the engine to do 16 bit image processing.</description>
		<content:encoded><![CDATA[<p>I&#8217;m reading the data in as 3&#215;8 bit but I&#8217;m converting it to 3&#215;16 bit because I want the engine to do 16 bit image processing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Top Posts &#171; WordPress.com</title>
		<link>http://schani.wordpress.com/2007/06/29/performance/#comment-6054</link>
		<dc:creator>Top Posts &#171; WordPress.com</dc:creator>
		<pubDate>Sat, 30 Jun 2007 00:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://schani.wordpress.com/2007/06/29/performance/#comment-6054</guid>
		<description>[...] Performance I have three implementations of the B&#38;W image processing core now. One of them uses GEGL, another one is written in C# [&#8230;] [...]</description>
		<content:encoded><![CDATA[<p>[...] Performance I have three implementations of the B&amp;W image processing core now. One of them uses GEGL, another one is written in C# [&#8230;] [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
