# Removal of \`virtual\` keywords from ConstNeighborhoodIterator

**URL:** <https://discourse.itk.org/t/removal-of-virtual-keywords-from-constneighborhooditerator/814>\
**Category:** Engineering\
**Created:** [March 30, 2018, 2:04pm UTC](https://discourse.itk.org/t/removal-of-virtual-keywords-from-constneighborhooditerator/814 "2018-03-30T14:04:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)\
**Post date:** [March 30, 2018, 5:39pm UTC](https://discourse.itk.org/t/removal-of-virtual-keywords-from-constneighborhooditerator/814/5 "2018-03-30T17:39:59Z")

</div>

FYI, I did observe the ~18% reduction of run-time duration by running the following little program, before and after the patch ([PERF: Removed all ‘virtual’ keywords from ConstNeighborhoodIterator](http://review.source.kitware.com/#/c/23285/5)):

```
#include <itkHoughTransform2DCirclesImageFilter.h>
#include <iostream>
#include <ctime>

int main()
{
  typedef unsigned char PixelType;
  const auto image = itk::Image<PixelType>::New();
  enum { sizeX = 19000, sizeY = sizeX };
  image->SetRegions({ sizeX, sizeY });
  image->Allocate();
  image->FillBuffer(1);

  const auto filter =
    itk::HoughTransform2DCirclesImageFilter<PixelType, unsigned char, double>::New();
  filter->SetInput(image);

  std::cout << "Start" << std::endl;
  const auto time1 = std::time(nullptr);
  filter->Update();
  const auto time2 = std::time(nullptr);

  std::cout << "Duration: " << (time2 - time1) << " seconds" << std::endl;
}

```

It was built by Visual C++ 2015 (Update 3), 64-bit, _Release_ configuration. Before the patch, filter-\>Update() took _at least_ 28 seconds on my machine (at work), while it could do it in 23 seconds after the patch. So I gained 5 seconds. 5/28 is about 18%.

I’m interested to hear from any of you if you can also observe that the patch yields such a significant performance improvement. If you have the time, please try to compile + run my little program before and after the patch, and tell us the result!

Note: the little test program here is an adapted version of the test program I posted at [Hough Transform 2D Circles Image Filter GetCircles patch.](https://discourse.itk.org/t/hough-transform-2d-circles-image-filter-getcircles-patch/350/36) just having a higher value for _sizeX_ and _sizeY_.

---

_[View the full topic](https://discourse.itk.org/t/removal-of-virtual-keywords-from-constneighborhooditerator/814)._
