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

perf: decrease scheduler checks from every 1 second to 10 seconds #409

Merged
merged 3 commits into from
Nov 20, 2022

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Nov 3, 2022

Description

Change the time interval for the scheduler to check for queued tasks to ten seconds.

Motivation and Context

Lower system resource usage.

Related Issue(s)

#362

How Has This Been Tested?

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@github-actions github-actions bot added the zinit label Nov 3, 2022
@psprint psprint force-pushed the sched-calls-5-secs branch from e45fec1 to 6eba10b Compare November 3, 2022 11:04
@psprint psprint changed the title Make scheduler be called in 5 seconds interval after first 5 seconds. Make scheduler be called in 5 seconds interval after no more scheduled tasks Nov 3, 2022
@psprint
Copy link
Contributor Author

psprint commented Nov 3, 2022

I've updated the PR to check if there are any more tasks and schedule for 10s if not.

@psprint psprint mentioned this pull request Nov 3, 2022
1 task
@jankatins
Copy link
Contributor

Stupid question: is this running forever? If so: why? Can't it be stoped once all tasks have been run (and restarted, if there every comes in a new task)?

@psprint
Copy link
Contributor Author

psprint commented Nov 3, 2022 via email

@psprint psprint force-pushed the sched-calls-5-secs branch from 6eba10b to ea67c6d Compare November 8, 2022 08:53
@psprint
Copy link
Contributor Author

psprint commented Nov 8, 2022

I've added short-circuit return if no tasks, so basically it's 1 line of code every 10 seconds if no tasks.

Copy link
Member

@pschmitt pschmitt left a comment

Choose a reason for hiding this comment

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

Lgtm

zinit.zsh Outdated Show resolved Hide resolved
zinit.zsh Outdated Show resolved Hide resolved
@vladdoster vladdoster merged commit 4938e84 into zdharma-continuum:main Nov 20, 2022
@vladdoster vladdoster changed the title Make scheduler be called in 5 seconds interval after no more scheduled tasks perf: decrease scheduler checks from every 1 second to 10 seconds Nov 20, 2022
@vladdoster
Copy link
Member

This breaks the wait ice.

@github-actions
Copy link

🎉 This PR is included in version 3.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

psprint added a commit to psprint/.priv-zinit-fork that referenced this pull request Dec 30, 2022
…harma-continuum#409)

The scheduler is called in 10 seconds intervals when no tasks are present to lower CPU usage.

Co-authored-by: vladislav doster <[email protected]>
psprint pushed a commit to psprint/.priv-zinit-fork that referenced this pull request Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants