Skip to content

Conversation

@Dandandan
Copy link
Contributor

@Dandandan Dandandan commented Jul 8, 2021

Which issue does this PR close?

Closes #697

Rationale for this change

Currently, when polling for work, the executor always waits 250 ms in between polling for tasks.
This means if the tasks themselves are small, it can be unproductive for a large percent of the time.

We can track whether we received tasks in the last iterations to avoid sleeping.

Also a slightly lower sleep time (e.g. 100ms) can help reduce the initial delay.

What changes are included in this PR?

Keep track of whether we received some tasks last time. If it's the case we don't sleep, otherwise we do.

Also reduce hard-coded 250 to 100ms to reduce initial delay a bit.

For a single executor on query 12 / SF=1, the time to execute goes from >5.5s to ~2.5s

Are there any user-facing changes?

FYI @andygrove

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

💯

@Dandandan Dandandan changed the title Avoid sleeping between tasks Ballista: Avoid sleeping between tasks Jul 8, 2021
@Dandandan Dandandan changed the title Ballista: Avoid sleeping between tasks Ballista: Avoid sleeping between polling for tasks Jul 8, 2021
@Dandandan Dandandan merged commit 63727df into apache:master Jul 9, 2021
@houqp houqp added the performance Make DataFusion faster label Jul 29, 2021
H0TB0X420 pushed a commit to H0TB0X420/datafusion that referenced this pull request Oct 7, 2025
Closes apache#672 rustls
Closes #682 syn
Closes apache#653 parking_lot
closes apache#648 object_store
Closes apache#625 h2
Closes apache#623 tokio
Closes apache#608 mio
Closes apache#597 pyo3
Closes apache#642 pyo3-build-config
Closes apache#627 prost
Closes apache#634 prost-types
Closes apache#637 async-trait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Make DataFusion faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ballista: Avoid sleeping in between polling for tasks

3 participants