TheAssemblyArmada / Thyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
584 stars 59 forks source link

Move always.h from headers to cpp files #1121

Closed xezon closed 8 months ago

xezon commented 8 months ago

This change aims to further reduce compile times.

On my machine with SSD, this reduces compile time in Debug configuration by 1 second - from 42 seconds to 41 seconds.

Disadvantage of this change

Most headers will no longer compile on their own when included in a cpp file. Every cpp file now needs to have always.h included at the very top. Our clang-format already sorts it that way.

Advantage of this change

This principle causes less file includes and a bit faster compilation.

Also, it allows the project to use precompiled headers moving forward. For next steps, we can move always.h into a stdafx.h, and then bundle it with some other hot files such as xfer.h and asciistring.h, and include stdafx.h instead of always.h in all cpp files.

https://en.wikipedia.org/wiki/Precompiled_header

precomp

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 2.54%. Comparing base (b013231) to head (4c6df87).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1121 +/- ## ======================================== Coverage 2.54% 2.54% ======================================== Files 949 949 Lines 110299 110299 Branches 18881 18881 ======================================== Hits 2802 2802 Misses 107094 107094 Partials 403 403 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

xezon commented 8 months ago

I don't feel strongly about this change. We can close it.

As for multi platform, Windows by far is the most important platform because this is what 99% of the actual players use, so any development improvements for Windows platform are worthwhile improvements.