Compilers used:
Environment used - Windows 7 on an SSD, Intel i7 3770k, 16g RAM
Room temperature: 18
The benchmark is done with this script only under Windows (but can be adapted for Unix) using CMake.
The script generates 501 source files and in 500 of them makes a function in the form of int f135() { return 135; }
and in main.cpp
it forward declares all the 500 such dummy functions and accumulates their result to return from the main()
function. This is done to ensure that all source files are built and that the linker doesn't remove something.
baseline - how much time the source files need for a single threaded build with msbuild
/mingw32-make
with implementation - only in main.cpp
the header is included with a #define
before it so it gets implemented:
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest.h" ```
baseline | with implementation | + header everywhere | + a test everywhere | + disabled | |
---|---|---|---|---|---|
MSVC Debug | 14.2 | 15.1 | 18.3 | 21.4 | 15.6 |
MSVC Release | 13.4 | 14.5 | 18.7 | 23.2 | 15.2 |
GCC Debug | 22.7 | 24.1 | 29.2 | 38 | 25 |
GCC Release | 22.9 | 25 | 30 | 45 | 25 |