PERF: Use initializer list in ShapedImageNeighborhoodRange operator* - #144
Conversation
Results in ~10% performance increase.
| reference operator*() const ITK_NOEXCEPT | ||
| { | ||
| return reference(m_ImageBufferPointer, m_ImageSize, m_OffsetTable, m_NeighborhoodAccessor, m_Location + *m_CurrentOffset); | ||
| return reference{m_ImageBufferPointer, m_ImageSize, m_OffsetTable, m_NeighborhoodAccessor, m_Location + *m_CurrentOffset}; |
There was a problem hiding this comment.
I'm fine with using curly braces instead of parentheses, but it only looks like a STYLE issue to me. (Actually I originally wanted to use curly braces on that line of code but KWStyle complained, at that time. If I remember correctly!) So are you sure that this change really has such an impact on the performance? If so, do you have a clue why?
There was a problem hiding this comment.
Yes, older versions of KWStyle will complain about }; 😞 , but this has been fixed in newer versions ☀️ .
I did observe the speed up, but I do not know the details of why this makes a difference to the compiler.
There was a problem hiding this comment.
Glad to hear KWStyle no longer complains about this }; syntax!
With which specific compiler version did you observe the speed-up? Because it sounds like a compiler issue to me! I just tried, but did not observe a significant performance difference between curly braces and parentheses on VS2017 (Version 15.8.9).
Anyway, the code change you're proposing here is perfectly fine to me.
Fix the crash when 3D tile configuration has only a single layer
Fix the crash when 3D tile configuration has only a single layer
Fix the crash when 3D tile configuration has only a single layer
Fix the crash when 3D tile configuration has only a single layer
…/rename_structure_tensor Style: Rename itkStructureTensor to itkStructureTensorImageFilter
…/rename_structure_tensor Style: Rename itkStructureTensor to itkStructureTensorImageFilter
Results in ~10% performance increase.
@N-Dekker this came up when testing the new constant boundary condition in ITKUltrasound.