# 2.2 seconds out of my 7.5 seconds configure time is spent looking for two binaries in CTest.cmake

**URL:** https://discourse.cmake.org/t/2-2-seconds-out-of-my-7-5-seconds-configure-time-is-spent-looking-for-two-binaries-in-ctest-cmake/6943
**Category:** Development
**Tags:** os:windows, tool:ctest
**Created:** [November 23, 2022, 4:08pm UTC](https://discourse.cmake.org/t/2-2-seconds-out-of-my-7-5-seconds-configure-time-is-spent-looking-for-two-binaries-in-ctest-cmake/6943 "2022-11-23T16:08:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![quijote](https://discourse.cmake.org/user_avatar/discourse.cmake.org/quijote/32/2948_2.png) [@quijote](https://discourse.cmake.org/u/quijote)
#### Post date: [November 23, 2022, 4:08pm UTC](https://discourse.cmake.org/t/2-2-seconds-out-of-my-7-5-seconds-configure-time-is-spent-looking-for-two-binaries-in-ctest-cmake/6943/1 "2022-11-23T16:08:22Z")

</div>

I am working on a large project using cmake. Profiling with `--profiling-format google-trace` showed the following:

2.2 seconds out of my 7.5 seconds configure time is spent looking for `MEMORYCHECK_COMMAND` and `COVERAGE_COMMAND` in CTest.cmake on Windows.

 ![ctest](https://discourse.cmake.org/uploads/default/original/2X/4/409823eb0145dfdb4ab2a89508f7e481f5d53da4.png)

Responsible code is here:

> <https://github.com/Kitware/CMake/blob/master/Modules/CTest.cmake#L175>

I configure frequently but I am currently not using either memory checks or code coverage. Would it be possible to opt-out of this functionality in order to speed up my configuration by 30%?

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [November 23, 2022, 8:14pm UTC](https://discourse.cmake.org/t/2-2-seconds-out-of-my-7-5-seconds-configure-time-is-spent-looking-for-two-binaries-in-ctest-cmake/6943/2 "2022-11-23T20:14:45Z")

</div>

You must not `include(CTest)`, use `enable_testing()`

If you do, you may waste time, but only on windows, it seems?

 ![Bildschirm­foto 2022-11-23 um 21.11.05](https://discourse.cmake.org/uploads/default/original/2X/7/7aa951f955cb39e2fe5178dbed3537fdbb052672.png)

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 23, 2022, 9:18pm UTC](https://discourse.cmake.org/t/2-2-seconds-out-of-my-7-5-seconds-configure-time-is-spent-looking-for-two-binaries-in-ctest-cmake/6943/3 "2022-11-23T21:18:14Z")

</div>

Interesting that the slow `find_program()` call uses a registry location for `PATHS`. I wonder if that might be related to why that particular call is so slow. Would be interesting to temporarily comment that out to see if it made any difference in your case.

---

<div class="post-metadata">

### Author: ![quijote](https://discourse.cmake.org/user_avatar/discourse.cmake.org/quijote/32/2948_2.png) [@quijote](https://discourse.cmake.org/u/quijote)
#### Post date: [November 24, 2022, 7:53am UTC](https://discourse.cmake.org/t/2-2-seconds-out-of-my-7-5-seconds-configure-time-is-spent-looking-for-two-binaries-in-ctest-cmake/6943/4 "2022-11-24T07:53:21Z")

</div>

Thank you. Using `enable_testing()` instead of `include(CTest)` indeed reduced configuration time to roughly 5.5 seconds. Tests still seem to run fine on command line and in CLion.

I tried commenting out the two lines

```auto
    PATHS
    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"

```

But this did not have much effect.

Changing to 1 instead of 6 commands, so instead of

```auto
NAMES purify valgrind boundscheck drmemory cuda-memcheck compute-sanitizer

```

to

```auto
NAMES purify

```

reduces time roughly linearly, to 800ms for `include(CTest)`.
