Skip to content

perf: resolve compilation hang in release mode and fix port conflicts#99

Merged
dk-uppi-aks merged 7 commits into
developfrom
20260524_optimize_axum_router_chain
May 24, 2026
Merged

perf: resolve compilation hang in release mode and fix port conflicts#99
dk-uppi-aks merged 7 commits into
developfrom
20260524_optimize_axum_router_chain

Conversation

@dk-uppi-aks
Copy link
Copy Markdown
Contributor

@dk-uppi-aks dk-uppi-aks commented May 24, 2026

Overview

This PR resolves the release-mode compilation hang during Docker image builds and fixes docker compose swarm port conflicts with GitLab on host servers.

Key Changes

  1. Axum Router Optimization:

    • Refactored build_router() in runtime_routes.rs to register routes statement-by-statement (router = router.route(...)) rather than using a single, deeply nested chained expression. This eliminates the compiler type-inference and trait-checking bottlenecks.
  2. Cargo Profile Overrides:

    • Overrides coreason-manifest-types to build at opt-level = 0 in release mode. This resolves the backend LLVM optimizer hang on the massive 6MB ontology.rs file (containing over 128,000 lines of generated code with heavy serialization macros).
    • Overrides coreason-server to build at opt-level = 0 in release mode.
    • Set lto = false in the release profile to disable Link-Time Optimization, reducing link phase duration and memory consumption.
    • Kept standard release optimizations (opt-level = 3) active for performance-critical engine and ledger crates.
  3. Swarm Port Configuration & Conflict Resolution:

    • Resolved port binding conflicts in docker-compose.e2e.yaml on host servers running GitLab:
      • Mapped gateway to host port 8089 (internal 8080).
      • Mapped the new openshell-manager to host port 8087 (internal 8080).
    • Refactored E2E swarm test files (decentralized_trust_pki_federation.rs, temporal_dag_resiliency.rs, and remote_inference_schema_fallback.rs) to dynamically read the gateway URL from the COREASON_GATEWAY_URL environment variable (falling back to http://localhost:8080).
  4. Timings & Diagnostics:

    • Added sequential builds and --timings --verbose flags to Dockerfile cargo compilation steps to provide timing and progress diagnostics.

Verification

  • Checked that cargo check -p test-suite compiles successfully.
  • Confirmed that building with the optimization overrides runs successfully and compiles quickly without hangs.

@dk-uppi-aks dk-uppi-aks requested a review from gowthamrao as a code owner May 24, 2026 18:17
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@dk-uppi-aks dk-uppi-aks changed the base branch from main to develop May 24, 2026 18:17
@dk-uppi-aks dk-uppi-aks changed the title 20260524 optimize axum router chain perf: resolve compilation hang in release mode and fix port conflicts May 24, 2026
@dk-uppi-aks dk-uppi-aks merged commit ded8501 into develop May 24, 2026
4 of 6 checks passed
@github-actions github-actions Bot mentioned this pull request May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant