Skip to content

Compile swig message wrappers with lower optimization#1355

Closed
schaubh wants to merge 2 commits into
developfrom
feature/speed_up_build_time
Closed

Compile swig message wrappers with lower optimization#1355
schaubh wants to merge 2 commits into
developfrom
feature/speed_up_build_time

Conversation

@schaubh
Copy link
Copy Markdown
Contributor

@schaubh schaubh commented Apr 13, 2026

  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

This PR improves clean build time by reducing optimization only for the generated messaging SWIG wrapper targets. These generated wrapper translation units are expensive for the compiler to optimize and are not expected to be runtime-critical compared with Basilisk simulation and FSW source modules.

The change is intentionally target-local: normal Basilisk source modules continue to use the existing project optimization settings, while the generated messaging wrapper modules use lower optimization for release-style builds.

In local testing, a clean build improved from approximately 3:51 to 2:33.

Verification

Validated with a full rebuild and the messaging unit test suite:

.venv/bin/cmake -S src -B dist3
.venv/bin/cmake --build dist3 -j 8
.venv/bin/pytest -q src/architecture/messaging/_UnitTest

The messaging unit tests passed:

72 passed in 40.24s

No automated tests were added because this is a build-system optimization that should preserve generated messaging behavior rather than introduce new runtime functionality.

Documentation

Added a release-note snippet describing the build-time improvement:

docs/source/Support/bskReleaseNotesSnippets/messaging-wrapper-build-optimization.rst

No user-facing documentation was otherwise invalidated.

Future work

If additional build-time reductions are desired, follow-up work could profile other generated wrapper targets or evaluate compiler/cache settings. The previous batching approach for messaging SWIG modules was tested separately and increased clean build time, so this PR keeps the safer per-target structure.

@schaubh schaubh requested a review from ReeceHumphreys April 13, 2026 00:55
@schaubh schaubh self-assigned this Apr 13, 2026
@schaubh schaubh added this to Basilisk Apr 13, 2026
@schaubh schaubh added the build Build system or compilation enhancement label Apr 13, 2026
@schaubh schaubh requested a review from a team as a code owner April 13, 2026 00:55
schaubh added 2 commits April 12, 2026 18:55
Compile the generated messaging SWIG wrapper targets with reduced
optimization in release-style builds. These generated translation units
dominate clean build time, and lowering optimization on the wrappers avoids
spending compiler effort where runtime performance is not expected to be
critical.

Keep the change target-local so Basilisk simulation and FSW source modules
continue to use the normal project optimization settings.
@schaubh schaubh force-pushed the feature/speed_up_build_time branch from 120d2c8 to 133d0a7 Compare April 13, 2026 00:56
@schaubh
Copy link
Copy Markdown
Contributor Author

schaubh commented Apr 13, 2026

While the compile times did increase by about 33%, the resulting time it took to run all pytest unit tests increased by about 33%. This is not an acceptable trade-off. Closing this PR.

@schaubh schaubh closed this Apr 13, 2026
@github-project-automation github-project-automation Bot moved this to ✅ Done in Basilisk Apr 13, 2026
@schaubh schaubh deleted the feature/speed_up_build_time branch April 13, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system or compilation enhancement

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant