Skip to content

Changing watch to maintain a context rather than recalculating state summary each time #218

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

Merged
merged 5 commits into from
Nov 4, 2019

Conversation

JamesMurkin
Copy link
Contributor

Currently whenever we want to summary of the events we watch. We loop through every job we have seen events for and sum up which state they are currently in.

This becomes very slow when you have 50000+ jobs, as each event you'll process all 50000 jobs

Now we hold a summary of the current state, so it isn't recalculated on each event.

  • Each event just updates the current state
  • Getting a summary of the current state is just a case of looking it up, rather than recalculating

We could do more optimisations to make starting watching a big jobset faster:

  • Start from current (This may make the summary confusing however, as it won't include all jobs in the jobset)
  • We could not print anything until we catch up with the current state
    • Or just print every 1s rather than every event

Printing takes most of the time now. So skipping past until current saves a LOT of time

…ry each time

Currently whenever we want to summary of the events we watch. We loop through every job we have seen events for and sum up which state they are currently in.

This becomes very slow when you have 50000+ jobs, as each event you'll process all 50000 jobs

Now we hold a summary of the current state, so it isn't recalculated on each event.
 - Each event just updates the current state
 - Getting a summary of the current state is just a case of looking it up, rather than recalculating

We could do more optimisations to make starting watching a big jobset faster:
 - Start from current (This may make the summary confusing however, as it won't include all jobs in the jobset)
 - We could not print anything until we catch up with the current state
   - Or just print every 1s rather than every event

Printing takes most of the time now. So skipping past until current saves a LOT of time
@JamesMurkin
Copy link
Contributor Author

#160

@JamesMurkin JamesMurkin merged commit ac9437c into master Nov 4, 2019
@JamesMurkin JamesMurkin deleted the watch-context branch November 4, 2019 11:16
d80tb7 added a commit that referenced this pull request Sep 5, 2024
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.

2 participants