Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify pending work tracking #1662

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Mar 4, 2025

Alan and I were talking in person about pending work tracking in the Downstairs, and I found some room for simplification:

  • Instead of tracking pending work and number of unmet dependencies in separate hashmaps, put them into a single struct PendingJob
  • Instead of using HashMap<JobId, IOop> then cloning + sorting the keys to make a Vec<JobId>, just use a VecDeque

This are relatively small cleanups, but may have a small impact on Downstairs RAM usage.

There are two behavior changes, both of which should be innocuous:

  • We now check whether jobs are ready in the order that they're received, instead of sorting all pending jobs by JobId then checking whether they're ready. This is fine, because readiness is determined by dependencies.
  • The show_work debug function no longer sorts job IDs when printing pending work

@mkeeter mkeeter merged commit 6e37930 into main Mar 6, 2025
17 checks passed
@mkeeter mkeeter deleted the mkeeter/simplify-pending-work branch March 6, 2025 16:39
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.

3 participants