Skip to content

Add --summary flag to bloop compile#2960

Merged
tgodzik merged 3 commits into
scalacenter:mainfrom
jozanek:feature/1367-compile-summary
Jun 15, 2026
Merged

Add --summary flag to bloop compile#2960
tgodzik merged 3 commits into
scalacenter:mainfrom
jozanek:feature/1367-compile-summary

Conversation

@jozanek

@jozanek jozanek commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #1367.

Summary

Adds bloop compile --summary, an opt-in flag that prints a compilation timing report at the end of a compile run. The feature is off by default so it does not affect interactive or IDE/BSP use.

Example output for a 4-module build where d was blocked by a failure in c:

================================================================================
b - 3314ms
a - 3244ms (failed)
d - blocked on c
Total module compile time: 6558ms
Wall-clock duration: 3412ms
================================================================================

Key design decisions:

  • Opt-in only — per jvican's original comment on the issue; the flag lives on Commands.Compile and does not affect the Test/Run/Link paths through compileAnd.
  • Dag-based, not cache-delta — the project set is built from Dag.dfs(getProjectsDag(…)) rather than ResultsCache.diffLatest, so every project in the requested compile closure is rendered on every run, including repeated failures where a Blocked result would be structurally equal to the cached one and would otherwise be dropped.
  • Two totalsTotal module compile time is the sum of per-module elapsed times (can exceed wall-clock under parallel/pipelined compilation); Wall-clock duration is a System.nanoTime measurement around the entire runCompile call, including the --incremental false clean step.
  • Slowest-first ordering — most useful for CI bottleneck identification. Untimed (blocked/error) projects are grouped after timed lines, sorted alphabetically.

Prints a per-module compile summary after the compile run completes.
Opt-in via --summary so it does not affect interactive or IDE use.

The summary shows:
- Each project's compile time (slowest first), annotated (failed) or
  (cancelled) when the compile did not succeed
- Projects blocked on a failed upstream (e.g. "b - blocked on a"),
  sourced from the dag closure so repeated failures don't drop them
- Total module compile time (sum of per-module times)
- Wall-clock duration (covers the full run, including any --incremental
  false clean step)

@tgodzik tgodzik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! That's a nice improvement

@tgodzik tgodzik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bloop.AutoCompleteSpec is failing again due to added flag, should be fine otherwise

@tgodzik tgodzik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgodzik tgodzik merged commit dfd423d into scalacenter:main Jun 15, 2026
11 of 13 checks passed
@jozanek jozanek deleted the feature/1367-compile-summary branch June 15, 2026 15:26
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.

Show a total project compilation time summary

2 participants