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

STEE: smarter idle waiting for scheduled tasks #81

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

nayato
Copy link
Member

@nayato nayato commented Apr 6, 2016

Motivation:
use of breakoutInterval setting on SingleThreadEventExecutor while executor is idling is confusing to users and inefficient due to fixed interval wake ups. We can do better by peeking next scheduled task and use its deadline for wait timeout.
While breakoutInterval is still useful while executor is busy, it can be reduced now to much lower number without impacting idle performance.

Modifications:

  • When going to wait due to empty immediate queue, consult with scheduled task queue to figure out timeout value (next task's deadline - now).
  • default breakoutInterval changed to 100 ms for higher resolution for scheduled tasks while busy.

Result:
Better precision for scheduled tasks at no performance cost while idling.

Motivation:
use of breakoutInterval setting on SingleThreadEventExecutor while executor is idling is confusing to users and inefficient due to fixed interval wake ups. We can do better by peeking next scheduled task and use its deadline for wait timeout.
While breakoutInterval is still useful while executor is busy, it can be reduced now to much lower number without impacting idle performance.

Modifications:
- When going to wait due to empty immediate queue, consult with scheduled task queue to figure out timeout value (next task's deadline - now).
- default breakoutInterval changed to 100 ms for higher resolution for scheduled tasks while busy.

Result:
Better precision for scheduled tasks at no performance cost while idling.
@mtuchkov
Copy link
Contributor

mtuchkov commented Apr 6, 2016

Sounds good

@nayato nayato merged commit ed028ed into Azure:dev Apr 6, 2016
@nayato nayato deleted the no-breakout branch April 10, 2016 22:04
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