Skip to content

Skip non-interactive live updates#837

Merged
tobiasraabe merged 4 commits intomainfrom
perf/skip-non-interactive-live-updates
Mar 28, 2026
Merged

Skip non-interactive live updates#837
tobiasraabe merged 4 commits intomainfrom
perf/skip-non-interactive-live-updates

Conversation

@tobiasraabe
Copy link
Copy Markdown
Member

Summary

Skip incremental live rendering when output is non-interactive, while keeping the live manager lifecycle intact.

Concretely:

  • wire LiveExecution and LiveCollection with render_immediately=console.is_interactive
  • skip per-event _update_table() / status refreshes when output is not interactive
  • keep final build table rendering and live manager startup/shutdown behavior unchanged

Motivation

On non-interactive output, the incremental Rich redraws are not user-visible, but pytask still pays the formatting and refresh cost on every task event. This change keeps the same end result while avoiding that repeated work.

Validation

  • uv run --group test pytest tests/test_live.py tests/test_build.py tests/test_execute.py tests/test_collect.py

Benchmark

Synthetic workload: 300 tiny non-provisional tasks, each with 3 path dependencies and 2 Annotated[..., Product] outputs.

On current main vs this branch:

  • collect: 0.915s -> 0.921s (+0.6%, noise)
  • build --force: 3.312s -> 2.893s (-12.7%)
  • warm build: 1.507s -> 1.462s (-3.0%)

These runs were measured sequentially with hyperfine over 7 runs.

@tobiasraabe tobiasraabe enabled auto-merge March 28, 2026 08:26
@tobiasraabe tobiasraabe added this pull request to the merge queue Mar 28, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Mar 28, 2026
@tobiasraabe tobiasraabe enabled auto-merge March 28, 2026 08:50
@tobiasraabe tobiasraabe added this pull request to the merge queue Mar 28, 2026
Merged via the queue into main with commit 3cc6dd8 Mar 28, 2026
24 checks passed
@tobiasraabe tobiasraabe deleted the perf/skip-non-interactive-live-updates branch March 28, 2026 08:57
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