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: definitely reduce scheduler task check to 10 second interval #435

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

psprint
Copy link
Contributor

@psprint psprint commented Dec 1, 2022

Description

The condition in #429 was reversed, it should say [[ -z … ]] not [[ -n ${ZINIT_TASKS:#<no-data>} ]] && return 0. Now after fixing this it should be working without problems.

Motivation and Context

To fix the long duration problem with the scheduler / CPU usage.

Related Issue(s)

Related issue: #429

How Has This Been Tested?

Types of changes

  • 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.

@jankatins
Copy link
Contributor

Is there any chance of creating a test that the scheduler actually works? E.g. like running a zsh -x -l 2>&1 with an zinit call with wait ice in .zshrc, run this in a background process, killing it after a few seconds and then see if some specific log entries show up after a few seconds in the output?

@psprint
Copy link
Contributor Author

psprint commented Dec 1, 2022 via email

@vladdoster
Copy link
Member

@psprint Could you elaborate on how to test this?

@psprint
Copy link
Contributor Author

psprint commented Dec 19, 2022

@vladdoster I would do: zi is-snippet wait for /dev/null and observe the delay to see that it oscillates around 10 seconds. Looking for the under prompt message.

@jankatins
Copy link
Contributor

@psprint Does that test the happy path of testing the wait ice, i.e. that a plugin with that ice actually gets loaded?

@psprint
Copy link
Contributor Author

psprint commented Dec 19, 2022

Yes. You can do some atclone'touch x' to easy test.

@vladdoster
Copy link
Member

vladdoster commented Dec 19, 2022

@psprint

Can you write one or two Zunit tests for this PR? I want verification to avoid borking main a third time and it would be a good test to have.

  • zdharma-continuum's zunit fork.

Copy link
Member

@vladdoster vladdoster left a comment

Choose a reason for hiding this comment

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

Please write a zunit test to verify this works.

@vladdoster
Copy link
Member

@psprint,

I want to merge this.

Can you elaborate on the following comment?:

Yes. You can do some atclone'touch x' to easy test.

Am I following correctly the test would be validating time difference ± N variance (e.g., using stat) from when the initial repository is cloned and file x was created?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants