catchorg / catchorg/Catch2

Compile Time Improvements

Open
#2,894 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Description**
Sort the sources in the src/CmakeLists.txt by compile times. When doing parallel builds in conjunction with unity builds it makes sense to have the biggest sources first.

**Additional context**
When building the lib, msvc generated projects should specify c++17. This is because, for c++20 msvc does a prepass search for module dependencies but this can double the compile times and it doesn't need to do this.

If we were _really serious_ about improving compile times...
Instead of just compiling all files individually or using cmake's unity build generated files, I would create 4 source files that included the actual sources. This would allow maintainers to distribute the sources so that each custom source file would compile in roughly the same time. And the reason to use 4 source files is coz most people have at least 4 threads.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.