# cv::drawContours performs slower and slower

**URL:** <https://forum.opencv.org/t/cv-drawcontours-performs-slower-and-slower/14685>\
**Category:** C++\
**Tags:** programming\
**Created:** [September 28, 2023, 2:52pm UTC](https://forum.opencv.org/t/cv-drawcontours-performs-slower-and-slower/14685 "2023-09-28T14:52:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunohendrickx](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@brunohendrickx](https://forum.opencv.org/u/brunohendrickx)\
**Post date:** [September 28, 2023, 2:52pm UTC](https://forum.opencv.org/t/cv-drawcontours-performs-slower-and-slower/14685/1 "2023-09-28T14:52:13Z")

</div>

Hi,

I’m running an image processing algorithm on Windows 10. There is a hot path that leverages `cv::findContours` and then `cv::drawContours`.  
While the former method remains stable in terms of performance, the latter method performs progressively worse.  
The output of `cv::findContours` does not vary much, hence the input to the `cv::drawContours` does not vary much as well.  
Any clues on why `cv::drawContours` performs worse and worse?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 28, 2023, 5:35pm UTC](https://forum.opencv.org/t/cv-drawcontours-performs-slower-and-slower/14685/2 "2023-09-28T17:35:34Z")

</div>

[MRE](https://stackoverflow.com/help/minimal-reproducible-example) required. you provided nothing that can be debugged.
