Skip to content

perf: parallelize independent rules in check --all #81

Description

@DataDave-Dev

Context

The engine runs one subprocess per rule, sequentially (engine.evaluate_run_check). On the normal commit path (a handful of staged files) this is instantaneous and correct. But becwright check --all on a large repo with many rules pays N sequential process starts + N full scans.

(The docs now state this honestly — see the Performance and limits section added in #77 — but stating a limit is not the same as removing it.)

Proposal

Rules are independent by design (each gets its own file list and subprocess), so they can run concurrently:

  • concurrent.futures.ThreadPoolExecutor around _run_check calls in evaluate — threads are enough since the work is subprocess-bound, no new dependency needed.
  • Keep output ordering deterministic: collect results, print in rule order.
  • BECWRIGHT_CHECK_TIMEOUT semantics unchanged (per check).

Acceptance

  • check --all wall-clock on a many-rule repo ≈ slowest rule, not the sum
  • Output identical to today (same order, same text)
  • No new runtime dependency

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformanceSpeed and resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions