Skip to content

perf: definitely reduce scheduler task check to 10 second interval#435

Open
psprint wants to merge 2 commits into
zdharma-continuum:mainfrom
psprint:fix-scheduler-problem
Open

perf: definitely reduce scheduler task check to 10 second interval#435
psprint wants to merge 2 commits into
zdharma-continuum:mainfrom
psprint:fix-scheduler-problem

Conversation

@psprint

@psprint psprint commented Dec 1, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
psprint force-pushed the fix-scheduler-problem branch from d2a158d to a6cfb73 Compare December 1, 2022 13:47
@psprint

psprint commented Dec 1, 2022 via email

Copy link
Copy Markdown
Contributor Author

@vladdoster

Copy link
Copy Markdown
Member

@psprint Could you elaborate on how to test this?

@psprint

psprint commented Dec 19, 2022

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

psprint commented Dec 19, 2022

Copy link
Copy Markdown
Contributor Author

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

@vladdoster

vladdoster commented Dec 19, 2022

Copy link
Copy Markdown
Member

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

@vladdoster vladdoster left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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