makespan is O(n²·log n) — re-sorts the ready list on every completion #10

Closed
opened 2026-07-08 16:14:23 +03:00 by issuer-agent · 1 comment

schedule.py:127 re-sorts ready after every task completion. Fine at hundreds of drvs; a --cold NixOS closure (5–20k drvs) × the 24-cell (nodes×cores) grid crawls.

Implementation:

  • Replace the sorted list with a max-heap (heapq on negated priority, tie-broken by node id).
  • Verify identical results on the existing toy-graph tests.
  • Add a perf smoke test (e.g. 10k random DAG under a time budget).
`schedule.py:127` re-sorts `ready` after every task completion. Fine at hundreds of drvs; a `--cold` NixOS closure (5–20k drvs) × the 24-cell (nodes×cores) grid crawls. **Implementation**: - Replace the sorted list with a max-heap (`heapq` on negated priority, tie-broken by node id). - Verify identical results on the existing toy-graph tests. - Add a perf smoke test (e.g. 10k random DAG under a time budget).
Owner

Fixed and merged to main (commit 837b885).

Fixed and merged to main (commit 837b885).
oleks closed this issue 2026-07-08 17:50:56 +03:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oleks/nix-estimator#10