REQUIRE has very large compilation time overhead
- Dominant language
- C++
- Stars
- 21.5k
- Forks
- 3.5k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
Hi,
After investigating the compilation time of my test cases, I have found that a lot of time was simply used by Catch and especially the REQUIRE macro. There are several reasons for that, but the main reason is that the macros are generating a lot of code and that because of the expression left and right hand sides deduction, it is hard to simplify the macros.
By introducing REQUIRE_EQUALS macros in my code and simplifying it to the maximum, I have been able to reduce the total compilation time of my tests by 27%!
If you are interested, you can have a look at: http://baptiste-wicht.com/posts/2016/06/reduce-compilation-time-by-another-16-with-catch.html for more information.
REQUIRE_EQUALS and CHECK_EQUALS may be something you want to consider for users that care about the compilation time.
Contributor guide
Assessment
This issue has not been assessed yet.