Skip to content

Refresh build status line periodically - #16015

Draft
Alizter wants to merge 2 commits into
ocaml:mainfrom
Alizter:refresh-build-status-timer
Draft

Refresh build status line periodically#16015
Alizter wants to merge 2 commits into
ocaml:mainfrom
Alizter:refresh-build-status-timer

Conversation

@Alizter

@Alizter Alizter commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

The build duration in the status line currently advances only when another
scheduler event redraws the line. During long-running rules it can therefore
appear frozen.

This change installs a scheduler-owned 200 ms periodic timer in the async I/O
loop. Each tick sends a coalesced, lowest-priority status-line refresh event.
The event wakes an idle scheduler, while ordinary scheduler events subsume a
pending refresh. Rendering continues to run on the scheduler thread through
the existing status-line refresh hook.

The timer's lifetime is tied to the async I/O loop and it is stopped and
destroyed during scheduler shutdown. No console backend or progress renderer
changes are needed.

Tests:

  • ./_boot/dune.exe runtest test/blackbox-tests/test-cases/status-line-refresh.t --force
  • dune build bin/main.exe
  • dune runtest test/blackbox-tests/test-cases/watching/rpc-build-status-line.t
  • manual PTY smoke test with a blocked long-running rule

@rgrinberg

Copy link
Copy Markdown
Member

Something is fishy in this PR

Why would it be necessary to cancel the timer that is updating the status line?

Why do we need the additional optimizations on top if we're updating the status five times a second?

@Alizter
Alizter force-pushed the refresh-build-status-timer branch from cd56cce to d2ce3c3 Compare August 17, 2026 22:59
@Alizter

Alizter commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

Something is fishy in this PR

Why would it be necessary to cancel the timer that is updating the status line?

You're right, it's completely unnecessary and was the cause of the performance issue I was trying to prematurely optimise. I've replaced it with something much simpler. I will iterate on it a bit further as I get the time.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
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.

2 participants