Skip to content

feat: Add timing and QUIET mode to Makefile#121

Open
angerman wants to merge 2 commits intostable-ghc-9.14from
feature/timing
Open

feat: Add timing and QUIET mode to Makefile#121
angerman wants to merge 2 commits intostable-ghc-9.14from
feature/timing

Conversation

@angerman
Copy link

@angerman angerman commented Dec 3, 2025

Summary

  • Add timing information for build phases (cabal, stage1, stage2, bindist, test)
  • Add QUIET=1 mode to suppress output unless there's an error
  • Show timing summary at end of build (even on failure)
  • Save timing data to _build/timing/summary.txt
  • Enable QUIET=1 in devx CI workflow

Usage

make                  # Normal build with timing summary at end
make QUIET=1          # Quiet build - output only on error
make timing-summary   # Show timing summary only

Example Output

+------------------+---------------+--------+
| Phase            | Duration      | Status |
+------------------+---------------+--------+
| cabal            |        2m 15s | OK     |
| stage1           |       45m 10s | OK     |
| stage2           |     1h 24m 5s | OK     |
| bindist          |        1m 12s | OK     |
+------------------+---------------+--------+
| TOTAL            |    2h 12m 42s |        |
+------------------+---------------+--------+

Test plan

  • Run make and verify timing summary appears at end
  • Run make QUIET=1 and verify output is suppressed
  • Verify logs are stored in _build/logs/
  • Verify timing data is saved to _build/timing/summary.txt

@angerman
Copy link
Author

angerman commented Dec 3, 2025

This should only be merged after #117 is merged. But before #118 is merged. So that we can get the timing comparison between non, and minimal stage1.

@angerman
Copy link
Author

Yikes, so many conflicts.

@angerman angerman force-pushed the feature/timing branch 2 times, most recently from 51d67c3 to c94ded3 Compare February 14, 2026 05:43
Add build phase timing instrumentation to the Makefile:

- QUIET mode (QUIET=1): suppresses build output, logs to files
- Phase timing via mk/run-phase.sh wrapper: records start/end/status
  for each build phase (cabal, stage1, stage2, stage2-utils, test)
- Bindist phase uses inline timing (avoids recursive $(MAKE) which
  breaks on FreeBSD where MAKE env var points to BSD make)
- timing-summary target: displays ASCII table of phase durations

New files:
  mk/run-phase.sh      - Phase execution wrapper with timing support
  mk/timing-summary.sh - ASCII table display of phase durations
Add system resource monitoring to CI builds:

- mk/collect-metrics.sh: cross-platform (Linux/macOS) background
  process that samples CPU% and memory usage to CSV
- mk/plot-metrics.py: generates dual-axis SVG plots (CPU + memory)
  with build phase annotations
- CI workflow: start/stop metrics collection around build+test,
  generate plots, upload to R2, embed in GitHub Job Summary
- Upload build logs and timing as artifacts
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