Precompiled headers#15
Precompiled headers#15HyperWinX merged 23 commits intoHyperCPU-Project:masterfrom aceinetx:precompiled-headers
Conversation
|
If you would like me to review this PR, either tag me in a comment or check this box: You can disable automatic comments on my settings page |
|
I'm getting to work. See my steps and track my cost here.
|
There was a problem hiding this comment.
PR Review: Precompiled Headers Implementation
I've reviewed the implementation of precompiled headers in the codebase and it looks well-executed with a clear performance benefit. Adding precompiled headers is a great way to improve build times, especially for C++ projects with many headers.
Strengths
-
Performance Improvement: The 2-minute reduction in build time (from 10m 30s to 8m 30s) is a significant improvement that will benefit developers.
-
Clean Implementation:
- The PCH files are well-organized with standard headers that rarely change.
- The
src/pch.hpphas comprehensive coverage of std library headers. - The
test/pch.hppis appropriately minimal with just what's needed for tests.
-
Build System Changes: The CMake integration is correctly done with
target_precompile_headers()for all relevant targets. -
Workflow Improvement: Updating the GitHub workflow to use
actions/checkout@v4is a good practice over manual git commands.
Minor Issues
-
Empty Header File:
src/Emulator/Core/CPU/Interrupts/InterruptHandler.hppappears to be empty. Is this intentional? -
A Few Redundant Includes: Some files like
src/Emulator/Misc/print.hppinclude headers directly that are already in the PCH. While not a functional issue, it's slightly inconsistent. -
Optimization Potential: The fmt-related includes could potentially be further optimized to ensure they're only in the PCH to avoid duplicate inclusion.
Conclusion
This is a solid PR that achieves its goal of improving build times. The implementation follows best practices for precompiled headers, and the approach taken is clean and maintainable.
The PR is ready to merge from my perspective, as the issues noted are minor and don't affect functionality.
* Add pch.hpp with the needed headers * cmake: precompile pch.hpp * pch.hpp: add comments * Use pch.hpp in Assembler/Core/Compiler.*pp * Correct formatting * Don't include fmt/base.h * Include pch.hpp instead of some system headers * add ```#pragma once``` * update a comment * Switch from gtest/gtest.h to pch.hpp * Remove non-existent header * Remove ```#pragma once``` in pch's * Fix recursive includes * Add fmt/base.h to pch.hpp * Revert ac07153 * Include only needed headers in Emulator/Misc/print.hpp * Include only needed headers in Emulator/Misc/bit_cast.hpp * Update pch * Fix workflow * Remove empty header that I created for some reason * Revert workflow fix * Update distro-ci workflow * Update workflow
Needs testing
This PR speeds up compilation times (from 10m 30s avg. to 8m 30s avg. according to 2 ci/cd runs) by adding precompiled headers.