Repository navigation
Modernization Phase 2.0: modules scaffolding + compile-time baselines - #28
Merged
Merged
Conversation
…S baselines - cmake/StreamrModules.cmake (canonical + synced per-package): Ninja and non-AppleClang guards, CMP0155 NEW, streamr_add_module_library() / streamr_enable_imports() helpers, STREAMR_IMPORT_STD opt-in (OFF). Scanning stays globally OFF; targets opt in via the helpers. - bench.sh: clean / incremental [header] / trace modes on the root single-tree build; trace integrates ClangBuildAnalyzer. - Baselines recorded in MODERNIZATION.md: clean 8s+102s (108 TUs); incremental StreamID.hpp 10 TUs/19s, SLogger.hpp 48 TUs/62-70s; 93% of compile CPU is frontend parsing; top expensive headers are DhtRpc.pb.h, SLogger/Logger.hpp, RpcCommunicator.hpp — the exact stack the module partitions wrap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 (C++ modules migration) begins. This phase adds the build scaffolding and — the main deliverable — the baseline numbers every later phase's compile-time claims will be measured against.
Scaffolding
cmake/StreamrModules.cmake(canonical, synced to every package bysync-cmake-files.sh— same standalone-publishability policy as the other helpers): Ninja + non-AppleClang guards,CMP0155 NEW,streamr_add_module_library()(STATIC +FILE_SET CXX_MODULESrooted at the package'smodules/),streamr_enable_imports()for import-using targets (tests), and theSTREAMR_IMPORT_STDopt-in (OFF per the locked decision; requires the CMake-version-specific experimental UUID explicitly). Module scanning stays globally OFF — targets opt in via the helpers, so clangd's compile commands stay clean for all non-migrated code (the exact failure mode that bit us in Phase 1.1).bench.sh:clean/incremental [header]/tracemodes measuring the root single-tree build (the workflow modules optimize — all 108 TUs: every test, generated proto, proxyclient). Prints host/compiler/parallelism with each run;tracebuilds a separatebuild-bench-trace/tree (reusesbuild/vcpkg_installed) and feeds ClangBuildAnalyzer.Baseline (macOS, Apple Silicon, clang 22.1.8, Debug, Ninja -j10)
StreamID.hppSLogger.hpp-ftime-trace)ClangBuildAnalyzer top expensive headers:
DhtRpc.pb.h96 s (33×),gtest.h84 s (stays#include),SLogger.hpp81 s (47×),Logger.hpp66 s (50×),ConnectionManager.hpp38 s (avg 9.5 s per inclusion),RpcCommunicator.hpp35 s,Identifiers.hpp31 s.The data confirms the migration's premise: >90% of compile CPU is repeated header parsing, and the top of the list is exactly the
.pb.h+ streamr-header stack the module partitions will wrap. Template-instantiation costs (nlohmann ~22 s,std::format~13 s, magic_enum ~13 s) are recorded too — modules won't move those, and post-migration numbers should be read with that in mind.Linux/iOS baselines: to be captured before the Phase 2.4 checkpoint (noted in MODERNIZATION.md).
Next
Phase 2.1: the streamr-eventemitter canary (std-only, concept-heavy, single header) + streamr-json — first real module partitions,
export(TARGETS)smoke test, and the clangd-experimental-modules check.🤖 Generated with Claude Code