Tried to switch a large project from Catch2 v3 to doctest and I see no perf improvements
Description
Hello,
We have an heavy 11 years old C++ project with tens of thousands tests. We have the tests amongst different executables. Each test executable represents a given project "service". We used to have single super-large test executable for everything, but the linker started choking hard, so we've spent a lot of time splitting the tests based on service ownership.
So anyway, still compiling all the test suites consumes about 40 minutes on a decent hardware, so we were really interested in doctest promises about much faster compilation speeds. Until recently this wasn't really an option, because of missing generators support, but I saw that this was added so I've decided to give it a shot. I switched one of ours service related test executables to doctest.
However... I see no compilation improvements at all. This specific executable takes 30 seconds to compile using Catch2 v3 and the same amount of time I see with doctest. I will provide some more info for that test suite:
Test cases: 106
Assertions: 1273
Number of cpp files: 13
Average number lines of code per file: 250
Version of doctest used: 2.5.2 Version of Catch2 v3 used: 3.7.1
Just to note that we consume both doctest and Catch2 using CMake's FetchContent_Declare method as described in the documentation. I have a hunch that nowadays Catch2 v3 if much faster compared to before, because it compiles as a static library with most of the heavy stuff moved to .cpp files, so pure header inclusion is fast.
Custom options used:
For Catch I use CATCH_CONFIG_FAST_COMPILE .
For doctest I use DOCTEST_CONFIG_SUPER_FAST_ASSERTS.
I assume if we used Catch as a single-header amalgamation, the compilation times would be much slower, but I don't really have anything against having a testing framework compiled as a static library.
Steps to reproduce
Just compile the same test suites using Catch2 v3(compiled as static library) and doctest and compare the compilation times.
doctest version
2.5.2
Operating system
Windows 11 and Ubuntu 22.04
Architecture
x86_64
Compiler
MSVC 14.44 and GCC 13.1
Context
No response
Source: doctest/doctest