Skip to content

Commit

Permalink
Various compilation speed improvements
Browse files Browse the repository at this point in the history
- Move GLHeaders into Main.h to be precompiled
- Moved Mus2Mid and ZReaders stuff out of thirdparty and into the main sources as they are using Main.h (for MemChunk), which is pretty hefty and meant to be precompiled
- The biggest change is splitting up the sol3 lua exports into multiple files where appropriate. This goes against the advice in the sol3 documentation (to put everything in one cpp file) but for me splitting it over multiple gives a massive compile speed improvement as parallel multi-core compilation can be better utilised. This change *may* cause compilation time to increase on older CPUS with less cores but hopefully it won't be too bad

These changes bring full rebuild time (on my Ryzen 7 7700X) down from ~35 seconds to ~22 seconds
  • Loading branch information
sirjuddington committed Mar 29, 2024
1 parent bc34c2c commit b896ef6
Show file tree
Hide file tree
Showing 37 changed files with 2,023 additions and 1,798 deletions.
1 change: 1 addition & 0 deletions src/Application/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ using u64 = uint64_t;
#include "Utility/Structs.h"
#include "General/Log.h"
#include "Utility/MemChunk.h"
#include "OpenGL/GLHeaders.h"
// clang-format on

#endif // __MAIN_H__
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ file(GLOB_RECURSE SLADE_SOURCES CONFIGURE_DEPENDS
TextEditor/*.cpp
UI/*.cpp
Utility/*.cpp
ZReaders/*.cpp
)

# Lua/Scripting sources if not excluded
Expand Down
4 changes: 2 additions & 2 deletions src/MainEditor/Conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include "Conversions.h"
#include "Archive/Archive.h"
#include "Archive/ArchiveEntry.h"
#include "thirdparty/mus2mid/mus2mid.h"
#include "thirdparty/zreaders/i_music.h"
#include "Mus2Mid.h"
#include "ZReaders/i_music.h"

using namespace slade;

Expand Down
Loading

0 comments on commit b896ef6

Please sign in to comment.