bitblast: wip cxx_compile_time_optimizations

This commit is contained in:
light7734 2025-11-30 09:30:44 +03:30
parent 475693f4e8
commit d666eda4f5
Signed by: light7734
GPG key ID: 8C30176798F1A6BA
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

View file

@ -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. 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 The next step is to replace Make with
## Ninja ## Ninja
no not this guy, but the build tool. no not this guy, but the build tool.
CCache ## CCache
Upgrade Compilers ## Upgrade Compilers
Next item is... disabling your Next item is... disabling your
Anti Virus ## Anti Virus / Windows Defender
Ensure Parallel Build # Ensure Parallel Build
-- Code Changes -- (from least to most intrusive) -- 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 -- -- Shut Up and Take My Money --
Upgrade Hardware Upgrade Hardware
@ -50,7 +51,7 @@ Upgrade Hardware
Build Over Network Build Over Network
# Sources # References
## Repositories ## Repositories
Mold: https://github.com/rui314/mold Mold: https://github.com/rui314/mold

View file

@ -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)
{
}
};

View file

@ -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 })
{
}

View file

@ -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;
};

View file

@ -0,0 +1,8 @@
#include <iostream>
int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
#include "./right_curly_brace.hpp"

View file

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
return 0;
}