<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I was able to get quite similar numbers on RH w/ gcc 4.4.7 in standard release mode:<div><br></div><div><div>Array size = 100, repetitions = 20000000</div><div>The elapsed time for a C++ fill_n 690000 ms.</div><div>The elapsed time for a itk.Fill 1910000 ms.</div><div>The elapsed time for a C fill 2620000 ms.</div><div><br></div><div>Array size = 1000, repetitions = 2000000</div><div>The elapsed time for a C++ fill_n 460000 ms.</div><div>The elapsed time for a itk.Fill 1700000 ms.</div><div>The elapsed time for a C fill 2520000 ms.</div><div><br></div><div>Array size = 10000, repetitions = 200000</div><div>The elapsed time for a C++ fill_n 420000 ms.</div><div>The elapsed time for a itk.Fill 1680000 ms.</div><div>The elapsed time for a C fill 2510000 ms.</div><div><br></div><div>Array size = 100000, repetitions = 20000</div><div>The elapsed time for a C++ fill_n 570000 ms.</div><div>The elapsed time for a itk.Fill 1670000 ms.</div><div>The elapsed time for a C fill 2510000 ms.</div><div><br></div><div>Array size = 1000000, repetitions = 2000</div><div>The elapsed time for a C++ fill_n 600000 ms.</div><div>The elapsed time for a itk.Fill 1680000 ms.</div><div>The elapsed time for a C fill 2510000 ms.</div><div><br></div><div>Array size = 10000000, repetitions = 200</div><div>The elapsed time for a C++ fill_n 1510000 ms.</div><div>The elapsed time for a itk.Fill 1820000 ms.</div><div>The elapsed time for a C fill 2540000 ms.</div><div><br></div><div>I did modify the test to set the value to 3.14, instead of 0, because other optimization may happen with a zero value...</div><div><br></div><div>Brad</div><div><br></div><div><div>On Apr 10, 2013, at 11:33 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div dir="ltr">Or maybe Ubuntu is milliseconds and windows is seconds?<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 10, 2013 at 11:28 AM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The Ubuntu timings are much longer than windows. Was that expected?<br><br></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div class="h5">On Wed, Apr 10, 2013 at 10:42 AM, <span dir="ltr"><<a href="mailto:M.Staring@lumc.nl" target="_blank">M.Staring@lumc.nl</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
<br>
-----Original Message-----<br>
From: Staring, M. (LKEB)<br>
Sent: woensdag 10 april 2013 16:28<br>
To: Insight Developers (<a href="mailto:insight-developers@itk.org" target="_blank">insight-developers@itk.org</a>)<br>
Subject: FW: fill<br>
<br>
Forgot to include the maliing list<br>
<br>
-----Original Message-----<br>
From: Staring, M. (LKEB)<br>
Sent: woensdag 10 april 2013 16:24<br>
To: 'Williams, Norman K'; <a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a><br>
Cc: <a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a><br>
Subject: RE: fill<br>
<br>
Hi,<br>
<br>
Attached you can find some timings for different POD types, I tested for short, int, float and double. std::fill_n is always faster, but less so for longer types.<br>
<br>
I simply modified itk::Array::Fill to use std::fill_n instead of referring to the vnl_vector::fill which uses a simple loop over the data. Not sure if this is the way to go, but my experimental looks green:<br>
<br>
<a href="http://open.cdash.org/buildSummary.php?buildid=2871413" target="_blank">http://open.cdash.org/buildSummary.php?buildid=2871413</a><br>
<br>
The patch I just submitted to gerrit:<br>
<br>
<a href="http://review.source.kitware.com/#/c/10801/" target="_blank">http://review.source.kitware.com/#/c/10801/</a><br>
<br>
Curious to your comments,<br>
<br>
Regards, Marius<br>
<br>
-----Original Message-----<br>
<br>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-developers<br></blockquote></div><br></div></body></html>