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

Use skip-list multi-map to speed up job queue #1212

Merged

Conversation

DavidLegg
Copy link
Contributor

  • Tickets addressed: N/A
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

Changes the data structure for job queue from a priority queue to a skip-list-based multimap. During some profiling for the Clipper model, we found that removing condition jobs from the queue in order to reprioritize them was taking significant time. To mitigate this, we use a skip-list based map to order batches, and store a set for each batch. In practice, this reduced runtime for a 1-year plan with the Clipper model from ~60 seconds to ~20 seconds.

Verification

Both the clipper model and a toy model were run with this changes while recording the number of jobs run and the number of resource samples taken. These numbers were verified not to change because of this change.

Documentation

N/A - purely an internal refactor

Future work

N/A - standalone change

@DavidLegg DavidLegg requested a review from a team as a code owner October 23, 2023 19:50
@mattdailis mattdailis self-requested a review October 24, 2023 02:05
Copy link
Contributor

@Mythicaeda Mythicaeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against develop and saw no issues. Thank you for this change!

For future reference, here is the cheat sheet @DavidLegg used to judge which data structure would help most with performance (notice the difference in remove's performance). This could be useful if we have other data structures we want to replace.

David Legg and others added 2 commits February 12, 2024 11:51
Co-authored-by: Matt Dailis <matthew.l.dailis@jpl.nasa.gov>
@mattdailis mattdailis force-pushed the feature--job-schedule-speedup branch from bb4b50b to 7a3b8ff Compare February 12, 2024 19:52
@mattdailis mattdailis merged commit 8adac55 into NASA-AMMOS:develop Feb 12, 2024
3 of 6 checks passed
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