Clever way of identifying the problem!  100000 is possibly catching only the low hanging fruit.  There may be even more culprits.<br><br>I concur with the other community members that these fixes are not show-stoppers for 4.2, and we can hammer them all out for an nice 4.3.<br>
<br>A 4.1.1 release would be nice as would a 3.20.2 release, but it is hard to find the resources for them...  I believe the Debian gentleman and ladies are packaging 4.1 for wheezy, and they might appreciate an easy-to-apply patch, though.<br>
<br>Thanks,<br>Matt<br><br>On Tue, Jul 3, 2012 at 2:51 PM, Bradley Lowekamp &lt;<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>&gt; wrote:<br>&gt; Ok, <br>&gt;<br>&gt; If you haven&#39;t notice I tend to iterate on things until I think they are<br>
&gt; right. So yea, release early and often, is a philosophy I should keep in<br>&gt; mind.<br>&gt;<br>&gt; I believe that these performance issue were introduced with changes to<br>&gt; ITKv4. I hope that ITKv4 doesn&#39;t give the impression of being slower than<br>
&gt; v3.<br>&gt;<br>&gt; Should we at least prepare this as a patch for a 4.1.1 release?<br>&gt;<br>&gt; Brad<br>&gt;<br>&gt; On Jul 3, 2012, at 10:39 AM, Bill Lorensen wrote:<br>&gt;<br>&gt; I agree with Hans that we should not delay the release.<br>
&gt;<br>&gt; I also agree with Brad that we need to address this particular performance<br>&gt; issue. We should make this a high priority for the next release.<br>&gt;<br>&gt; Bill<br>&gt;<br>&gt; On Tue, Jul 3, 2012 at 10:35 AM, Johnson, Hans J &lt;<a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>&gt;<br>
&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Brad,<br>&gt;&gt;<br>&gt;&gt; My opinion is that this has been an issue for many years, and that the<br>&gt;&gt; cost benefit is not worth trying to squeeze this into this release cycle. <br>
&gt;&gt; The results are (or at least should be) the same both before and after this<br>&gt;&gt; change.<br>&gt;&gt;<br>&gt;&gt; The backlog of new features and other performance improvements are<br>&gt;&gt; beginning to back up on the gerrit dashboard, so I would definitely vote for<br>
&gt;&gt; cutting ITKv4.2 as soon as possible so that all other projects can start<br>&gt;&gt; moving forward again.<br>&gt;&gt;<br>&gt;&gt; My guess is that the main culprits of those failing tests are related to<br>&gt;&gt; following 15 lines of code.  <br>
&gt;&gt;<br>&gt;&gt; ==============================<br>&gt;&gt; johnsonhj@neuron$ git grep &quot;\-&gt;GetInput()\-&gt;GetPixel&quot;<br>&gt;&gt;<br>&gt;&gt; Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx:   <br>
&gt;&gt; if ( this-&gt;GetInput()-&gt;GetPixel(idx) != this-&gt;m_BackgroundValue )<br>&gt;&gt; Modules/Filtering/ImageGrid/include/itkCyclicShiftImageFilter.hxx:   <br>&gt;&gt; outIt.Set( static_cast&lt; OutputImagePixelType &gt;( this-&gt;GetInput()-&gt;GetPixel(<br>
&gt;&gt; index ) ) );<br>&gt;&gt;<br>&gt;&gt; Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx: <br>&gt;&gt; seedValue = this-&gt;GetInput()-&gt;GetPixel(m_Seed);<br>&gt;&gt;<br>
&gt;&gt; Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx: <br>&gt;&gt; seedValue = this-&gt;GetInput()-&gt;GetPixel(m_Seed);<br>&gt;&gt;<br>&gt;&gt; Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx:       <br>
&gt;&gt; pixelIntensity = this-&gt;GetInput()-&gt;GetPixel( index );<br>&gt;&gt; Modules/Numerics/Statistics/test/itkSubsampleTest.cxx: <br>&gt;&gt; ArrayPixelImageType::PixelType pixel = filter-&gt;GetInput()-&gt;GetPixel(index);<br>
&gt;&gt;<br>&gt;&gt; Modules/Segmentation/Voronoi/include/itkVoronoiPartitioningImageFilter.hxx:   <br>&gt;&gt; getp = (double)( this-&gt;GetInput()-&gt;GetPixel(Plist[i]) );<br>&gt;&gt;<br>&gt;&gt; Modules/Segmentation/Voronoi/include/itkVoronoiSegmentationImageFilter.hxx:   <br>
&gt;&gt; getp = (double)( this-&gt;GetInput()-&gt;GetPixel(Plist[i]) );<br>&gt;&gt; ~/Dashboard/src/ITK (master)<br>&gt;&gt;<br>&gt;&gt; johnsonhj@neuron$ <br>&gt;&gt; ~/Dashboard/src/ITK (master)<br>&gt;&gt; johnsonhj@neuron$ git grep &quot;\-&gt;GetInput()\-&gt;Transform&quot;<br>
&gt;&gt; Modules/Core/Mesh/include/itkBinaryMask3DMeshSource.hxx:     <br>&gt;&gt; this-&gt;GetInput()-&gt;TransformContinuousIndexToPhysicalPoint(indTemp,new_p);<br>&gt;&gt;<br>&gt;&gt; Modules/Nonunit/Review/include/itkScalarChanAndVeseDenseLevelSetImageFilter.hxx:   <br>
&gt;&gt; this-&gt;GetInput()-&gt;TransformPhysicalPointToIndex(origin, start);<br>&gt;&gt;<br>&gt;&gt; Modules/Nonunit/Review/include/itkScalarChanAndVeseSparseLevelSetImageFilter.hxx:   <br>&gt;&gt; this-&gt;GetInput()-&gt;TransformPhysicalPointToIndex(origin, start);<br>
&gt;&gt;<br>&gt;&gt; Modules/Nonunit/Review/include/itkStochasticFractalDimensionImageFilter.hxx:         <br>&gt;&gt; this-&gt;GetInput()-&gt;TransformIndexToPhysicalPoint(It.GetIndex(i), point1);<br>&gt;&gt;<br>&gt;&gt; Modules/Nonunit/Review/include/itkStochasticFractalDimensionImageFilter.hxx:             <br>
&gt;&gt; this-&gt;GetInput()-&gt;TransformIndexToPhysicalPoint(It.GetIndex(j), point2);<br>&gt;&gt;<br>&gt;&gt; Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx:     <br>&gt;&gt; this-&gt;GetInput()-&gt;TransformIndexToPhysicalPoint(<br>
&gt;&gt;<br>&gt;&gt; Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx:     <br>&gt;&gt; this-&gt;GetInput()-&gt;TransformIndexToPhysicalPoint( lastGoodIndex, point );<br>&gt;&gt; ==============================<br>
&gt;&gt;<br>&gt;&gt; Hans<br>&gt;&gt; -- <br>&gt;&gt; Hans J. Johnson, Ph.D.<br>&gt;&gt; <a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a><br>&gt;&gt; Assistant Professor of Psychiatry<br>&gt;&gt; University of Iowa Carver College of Medicine<br>
&gt;&gt; W278 GH, 200 Hawkins Drive<br>&gt;&gt; Iowa City, Iowa 52242<br>&gt;&gt; Phone:  319-353-8587<br>&gt;&gt;<br>&gt;&gt; From: Bradley Lowekamp &lt;<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>&gt;<br>
&gt;&gt; Date: Tuesday, July 3, 2012 9:26 AM<br>&gt;&gt; To: ITK &lt;<a href="mailto:insight-developers@itk.org">insight-developers@itk.org</a>&gt;<br>&gt;&gt; Cc: &quot;<a href="mailto:Bill@public.kitware.com">Bill@public.kitware.com</a>&quot; &lt;<a href="mailto:Bill@public.kitware.com">Bill@public.kitware.com</a>&gt;, Hans Johnson<br>
&gt;&gt; &lt;<a href="mailto:hans.j.johnson@gmail.com">hans.j.johnson@gmail.com</a>&gt;, Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;<br>&gt;&gt; Subject: [Insight-developers] Performance Impact of using GetInput<br>
&gt;&gt;<br>&gt;&gt; Hello,<br>&gt;&gt;<br>&gt;&gt; A user yesterday, was reporting that going from ITK 3.20 to ITK 4.1, the<br>&gt;&gt; SignedMaurerDistanceMapImageFilter was running more that 2x-3x the time.<br>&gt;&gt; With a little bit of poking around and sampling the run time, I was able to<br>
&gt;&gt; develop the following patch:<br>&gt;&gt;<br>&gt;&gt; <a href="http://review.source.kitware.com/#/c/6367/">http://review.source.kitware.com/#/c/6367/</a><br>&gt;&gt;<br>&gt;&gt; I find that difference to be quite significant difference, and is on the<br>
&gt;&gt; level of a bug.<br>&gt;&gt;<br>&gt;&gt; The lead me to wonder how wide spread is this incorrect usage. So I added<br>&gt;&gt; an atomic counter to the GetInput, and GetOutput methods, and when they<br>&gt;&gt; exceed a threshold, an exception is throw. This is to detect when these<br>
&gt;&gt; methods may be used in an inner loop.<br>&gt;&gt;<br>&gt;&gt; <a href="http://review.source.kitware.com/#/c/6369/">http://review.source.kitware.com/#/c/6369/</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; I get the following test failure (where previously there was none):<br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; 97% tests passed, 71 tests failed out of 2382<br>&gt;&gt;<br>&gt;&gt; The following tests FAILED:<br>&gt;&gt; 160 - itkN4BiasFieldCorrectionImageFilterTest1 (Failed)<br>&gt;&gt; 161 - itkN4BiasFieldCorrectionImageFilterTest2 (Failed)<br>
&gt;&gt; 311 - itkMultiThreaderEnvTest88 (Failed)<br>&gt;&gt; 313 - itkMultiThreaderEnvTest123 (Failed)<br>&gt;&gt; 398 - itkFFTConvolutionImageFilterTest4x4Mean (Failed)<br>&gt;&gt; 399 - itkFFTConvolutionImageFilterTest4x5Mean (Failed)<br>
&gt;&gt; 400 - itkFFTConvolutionImageFilterTest5x5Mean (Failed)<br>&gt;&gt; 401 - itkFFTConvolutionImageFilterTest4x4MeanValidRegion (Failed)<br>&gt;&gt; 402 - itkFFTConvolutionImageFilterTest4x5MeanValidRegion (Failed)<br>
&gt;&gt; 403 - itkFFTConvolutionImageFilterTest5x5MeanValidRegion (Failed)<br>&gt;&gt; 420 - itkRichardsonLucyDeconvolutionImageFilterGaussianKernelTest (Failed)<br>&gt;&gt; 421 - itkRichardsonLucyDeconvolutionImageFilterIrregularKernelTest<br>
&gt;&gt; (Failed)<br>&gt;&gt; 422 - itkLandweberDeconvolutionImageFilterGaussianKernelTest (Failed)<br>&gt;&gt; 423 - itkLandweberDeconvolutionImageFilterIrregularKernelTest (Failed)<br>&gt;&gt; 425 - itkProjectedLandweberDeconvolutionImageFilterGaussianKernelTest<br>
&gt;&gt; (Failed)<br>&gt;&gt; 426 - itkProjectedLandweberDeconvolutionImageFilterIrregularKernelTest<br>&gt;&gt; (Failed)<br>&gt;&gt; 427 - itkInverseDeconvolutionImageFilterGaussianKernelTest (Failed)<br>&gt;&gt; 428 - itkInverseDeconvolutionImageFilterIrregularKernelTest (Failed)<br>
&gt;&gt; 429 - itkTikhonovDeconvolutionImageFilterGaussianKernelTest (Failed)<br>&gt;&gt; 430 - itkTikhonovDeconvolutionImageFilterIrregularKernelTest (Failed)<br>&gt;&gt; 431 - itkWienerDeconvolutionImageFilterGaussianKernelTest (Failed)<br>
&gt;&gt; 432 - itkWienerDeconvolutionImageFilterIrregularKernelTest (Failed)<br>&gt;&gt; 433 - itkParametricBlindLeastSquaresDeconvolutionImageFilterTest (Failed)<br>&gt;&gt; 436 - itkDeformableSimplexMesh3DBalloonForceFilterTest (Failed)<br>
&gt;&gt; 440 - itkPatchBasedDenoisingImageFilterTest0 (Failed)<br>&gt;&gt; 441 - itkPatchBasedDenoisingImageFilterTestGaussian (Failed)<br>&gt;&gt; 442 - itkPatchBasedDenoisingImageFilterTestRician (Failed)<br>&gt;&gt; 443 - itkPatchBasedDenoisingImageFilterTestPoisson (Failed)<br>
&gt;&gt; 521 - itkDisplacementFieldToBSplineImageFilterTest (Failed)<br>&gt;&gt; 524 - itkContourMeanDistanceImageFilterTest (Failed)<br>&gt;&gt; 525 - itkContourDirectedMeanDistanceImageFilterTest (Failed)<br>&gt;&gt; 530 - itkHausdorffDistanceImageFilterTest (Failed)<br>
&gt;&gt; 532 - itkSignedMaurerDistanceMapImageFilterTest1 (Failed)<br>&gt;&gt; 533 - itkSignedMaurerDistanceMapImageFilterTest2 (Failed)<br>&gt;&gt; 656 - itkFastMarchingImageFilterTest_torus_multipleSeeds_NoTopo (Failed)<br>
&gt;&gt; 657 - itkFastMarchingImageFilterTest_torus_multipleSeeds_StrictTopo<br>&gt;&gt; (Failed)<br>&gt;&gt; 658 - itkFastMarchingImageFilterTest_torus_multipleSeeds_NoHandlesTopo<br>&gt;&gt; (Failed)<br>&gt;&gt; 659 - itkFastMarchingImageFilterTest_wm_multipleSeeds_NoTopo (Failed)<br>
&gt;&gt; 660 - itkFastMarchingImageFilterTest_wm_multipleSeeds_StrictTopo (Failed)<br>&gt;&gt; 661 - itkFastMarchingImageFilterTest_wm_multipleSeeds_NoHandlesTopo<br>&gt;&gt; (Failed)<br>&gt;&gt; 1072 - itkBSplineControlPointImageFilterTest2 (Failed)<br>
&gt;&gt; 1079 - itkCyclicShiftImageFilterTest0 (Failed)<br>&gt;&gt; 1080 - itkCyclicShiftImageFilterTest1 (Failed)<br>&gt;&gt; 1081 - itkCyclicShiftImageFilterTest2 (Failed)<br>&gt;&gt; 1082 - itkCyclicShiftImageFilterTest3 (Failed)<br>
&gt;&gt; 1083 - itkCyclicShiftImageFilterTest4 (Failed)<br>&gt;&gt; 1084 - itkCyclicShiftImageFilterTest5 (Failed)<br>&gt;&gt; 1085 - itkCyclicShiftImageFilterTest6 (Failed)<br>&gt;&gt; 1195 - itkModulusImageFilterTest (Failed)<br>
&gt;&gt; 1377 - itkExtensionVelocitiesImageFilterTest (Failed)<br>&gt;&gt; 1378 - itkCannySegmentationLevelSetImageFilterTest (Failed)<br>&gt;&gt; 1412 - itkTwoLevelSetsv4DenseImage2DTest (Failed)<br>&gt;&gt; 1471 - itkSimplexMeshVolumeCalculatorTest (Failed)<br>
&gt;&gt; 1659 - itkBinaryMask3DQuadEdgeMeshSourceTest (Failed)<br>&gt;&gt; 1747 - itkPointSetToPointSetRegistrationTest (Failed)<br>&gt;&gt; 1774 - itkDiffeomorphicDemonsRegistrationFilterTest01 (Failed)<br>&gt;&gt; 1775 - itkDiffeomorphicDemonsRegistrationFilterTest02 (Failed)<br>
&gt;&gt; 1776 - itkDiffeomorphicDemonsRegistrationFilterTest03 (Failed)<br>&gt;&gt; 1777 - itkDiffeomorphicDemonsRegistrationFilterTest04 (Failed)<br>&gt;&gt; 1778 - itkDiffeomorphicDemonsRegistrationFilterTest05 (Failed)<br>
&gt;&gt; 1779 - itkDiffeomorphicDemonsRegistrationFilterTest06 (Failed)<br>&gt;&gt; 1780 - itkDiffeomorphicDemonsRegistrationFilterTest07 (Failed)<br>&gt;&gt; 1781 - itkDiffeomorphicDemonsRegistrationFilterTest08 (Failed)<br>
&gt;&gt; 1782 - itkDiffeomorphicDemonsRegistrationFilterTest09 (Failed)<br>&gt;&gt; 1783 - itkDiffeomorphicDemonsRegistrationFilterTest10 (Failed)<br>&gt;&gt; 1784 - itkDiffeomorphicDemonsRegistrationFilterTest11 (Failed)<br>
&gt;&gt; 1802 - itkFastSymmetricForcesDemonsRegistrationFilterTest (Failed)<br>&gt;&gt; 2166 - itkVoronoiSegmentationImageFilterTest (Failed)<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; How big of a deal if most of the filters here are running 2x+ slower then<br>
&gt;&gt; what they should be? Is it big enough to delay the Release and do another RC<br>&gt;&gt; with the fixes?<br>&gt;&gt;<br>&gt;&gt; I have also been looking at the methods used in GetInput, specifically the<br>&gt;&gt; methods used to create the std::string... It seems to be if we change the<br>
&gt;&gt; return value to a const std::string &amp;, then we could keep a static internal<br>&gt;&gt; table of the common value and return reference to the static table to even,<br>&gt;&gt; references to what is in the std::map, the would reduce the need for mallocs<br>
&gt;&gt; for std::string.<br>&gt;&gt;<br>&gt;&gt; Thoughts on what to do?<br>&gt;&gt;<br>&gt;&gt; Brad<br>&gt;&gt;<br>&gt;&gt; ========================================================<br>&gt;&gt; Bradley Lowekamp  <br>&gt;&gt; Medical Science and Computing for<br>
&gt;&gt; Office of High Performance Computing and Communications<br>&gt;&gt; National Library of Medicine <br>&gt;&gt; <a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; Notice: This UI Health Care e-mail (including attachments) is covered by<br>&gt;&gt; the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is<br>
&gt;&gt; confidential and may be legally privileged.  If you are not the intended<br>&gt;&gt; recipient, you are hereby notified that any retention, dissemination,<br>&gt;&gt; distribution, or copying of this communication is strictly prohibited. <br>
&gt;&gt; Please reply to the sender that you have received the message in error, then<br>&gt;&gt; delete it.  Thank you.<br>&gt;&gt; ________________________________<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>&gt;&gt;<br>&gt;&gt; Visit other Kitware open-source projects at<br>&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>&gt;&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt;&gt; <a href="http://kitware.com/products/protraining.php">http://kitware.com/products/protraining.php</a><br>&gt;&gt;<br>&gt;&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt;&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;&gt;<br>&gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt;&gt; <a href="http://www.itk.org/mailman/listinfo/insight-developers">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
&gt;&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Unpaid intern in BillsBasement at noware dot com<br>&gt;<br>&gt;<br>&gt; ========================================================<br>&gt;<br>&gt; Bradley Lowekamp  <br>&gt;<br>
&gt; Medical Science and Computing for<br>&gt;<br>&gt; Office of High Performance Computing and Communications<br>&gt;<br>&gt; National Library of Medicine <br>&gt;<br>&gt; <a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a><br>
&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt; <a href="http://kitware.com/products/protraining.php">http://kitware.com/products/protraining.php</a><br>
&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.itk.org/mailman/listinfo/insight-developers">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
&gt;<br><br>