bitblast: wip cxx_compile_time_optimizations
This commit is contained in:
parent
475693f4e8
commit
d666eda4f5
11 changed files with 66 additions and 11 deletions
Binary file not shown.
|
After Width: | Height: | Size: 778 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 904 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 750 KiB |
|
|
@ -19,30 +19,31 @@ or Mold Linker
|
|||
|
||||
As you can see, mold uses all available cores throughout its execution and finishes quickly. In contrast, lld fails to utilize available cores most of the time.
|
||||
|
||||
On a side-note, this project could you financial support...
|
||||
The next step is to replace Make with
|
||||
## Ninja
|
||||
no not this guy, but the build tool.
|
||||
|
||||
CCache
|
||||
## CCache
|
||||
|
||||
Upgrade Compilers
|
||||
## Upgrade Compilers
|
||||
|
||||
Next item is... disabling your
|
||||
Anti Virus
|
||||
## Anti Virus / Windows Defender
|
||||
|
||||
Ensure Parallel Build
|
||||
# Ensure Parallel Build
|
||||
|
||||
-- Code Changes -- (from least to most intrusive)
|
||||
Minimize Includes
|
||||
# Modules
|
||||
|
||||
Forward Declaration
|
||||
|
||||
Precompiled Headers
|
||||
# Minimize Includes
|
||||
|
||||
Unity Builds
|
||||
# Forward Declaration
|
||||
|
||||
# Precompiled Headers
|
||||
|
||||
# Unity Builds
|
||||
|
||||
Modules
|
||||
|
||||
-- Shut Up and Take My Money --
|
||||
Upgrade Hardware
|
||||
|
|
@ -50,7 +51,7 @@ Upgrade Hardware
|
|||
Build Over Network
|
||||
|
||||
|
||||
# Sources
|
||||
# References
|
||||
|
||||
## Repositories
|
||||
Mold: https://github.com/rui314/mold
|
||||
|
|
|
|||
BIN
youtube/video_series/bit_blast/cxx_compile_time_optimization/snippets/a.out
Executable file
BIN
youtube/video_series/bit_blast/cxx_compile_time_optimization/snippets/a.out
Executable file
Binary file not shown.
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
// Assume this file includes many other files...
|
||||
// Which accumulate to 50'000 lines of source code!
|
||||
|
||||
class Big
|
||||
{
|
||||
public:
|
||||
Big(int foo)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#include "./forward_decl.hpp"
|
||||
|
||||
// This inclusion will not leak to other header files...
|
||||
#include "./big.hpp"
|
||||
|
||||
IncludedManyTimes::IncludedManyTimes():
|
||||
m_large_dependency(new Big { 1 })
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#pragma once
|
||||
// This file will be included MANY times...
|
||||
|
||||
// Option A: forward declare on top of the file
|
||||
class Big;
|
||||
|
||||
class IncludedManyTimes
|
||||
{
|
||||
public:
|
||||
IncludedManyTimes();
|
||||
|
||||
private:
|
||||
// Option B: forward declare when delcaring the variable
|
||||
/* class */ Big *m_large_dependency;
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello world!" << std::endl;
|
||||
return 0;
|
||||
|
||||
#include "./right_curly_brace.hpp"
|
||||
|
|
@ -0,0 +1 @@
|
|||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue