Implement NIO scheduler for ZIO
https://nurmohammed840.github.io/posts/announcing-nio/
/bounty $2500
💎 $2,500 bounty • ZIO
💎 $10 bounty • petar
💎 $10 bounty • jairoemmanuelrojasramirez53
Steps to solve:
-
Start working: Comment
/attempt #9356with your implementation plan -
Submit work: Create a pull request including
/claim #9356in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to zio/zio!
Add a bounty • Share on socials
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🔴 @maq796113 | Nov 30, 2024, 3:58:06 PM | WIP |
| 🔴 @ahmedtariqkhan | Nov 30, 2024, 4:06:01 PM | WIP |
| 🟢 @promisingcoder | Dec 14, 2024, 8:54:21 AM | WIP |
| 🟢 @HollandDM | Dec 25, 2024, 10:57:44 AM | WIP |
| 🔴 @SAIKIRANSURAPALLI | Dec 31, 2024, 7:32:13 AM | WIP |
| 🟢 @abdelfetah18 | Mar 10, 2025, 5:37:03 PM | #9684 |
/attempt #9356 Plan is going to be as straightforward as it could be, where ill be implementing NIO with respect to checking performances with new techniques.
Options
[!NOTE] The user @maq796113 is already attempting to complete issue #9356 and claim the bounty. We recommend checking in on @maq796113's progress, and potentially collaborating, before starting a new solution.
@maq796113: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏
@ahmedtariqkhan: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏
The bounty is up for grabs! Everyone is welcome to /attempt #9356 🙌
Hi @jdegoes @kyri-petrou
I was going through the project, I didn't see any specific Spec file for ZScheduler, only RuntimeSpec and ExecutorSpec.
If one implements a NIO-LLScheduler, how should they test the correctness? is there any expectation on that like how tests should be shaped?
/attempt #9356
| Algora profile | Completed bounties | Tech | Active attempts | Options |
|---|---|---|---|---|
| @abdelfetah18 | 2 bounties from 1 project | Java, C++ |
Cancel attempt |
💡 @abdelfetah18 submitted a pull request that claims the bounty. You can visit your bounty board to reward.
Is this still available?
/attempt #9356
/attempt #9356
Hi all,
seems that the CI is failing on a step of action [Run re-actors/alls-green@release/v1](https://github.com/zio/zio/actions/runs/19160514157/job/54773148810#annotation:2:91) is this a known issue? Everything else (linter, localPublish and tests) pass correctly.
EDIT: issue with PR resolved, waiting for review
Hey! Really interesting challenge here. I've been looking into the Nio scheduler approach and think we can adapt something similar for ZIO.
/attempt #9356
So here's what I'm thinking - the Least-Loaded scheduler from Nio is pretty elegant compared to work-stealing. Instead of all that complex bookkeeping, we just track which worker has the least work and send new fibers there. Simple but effective.
My plan:
First, I need to understand how ZIO currently does scheduling. I'll dig into the Runtime internals and see where we can hook in. The main thing is figuring out how to measure "load" - probably queue size plus active fibers running on each worker.
Then build the core scheduler logic. The Rust version is only 150 lines, so the ZIO version shouldn't be too crazy either. Main challenge will be making it thread-safe without killing performance.
Testing is going to be key. Those Nio benchmarks looked promising - 3x better in some cases! I want to set up similar tests with ZIO workloads and see if we get comparable improvements.
I'm particularly curious about how this will handle ZIO's interruption model and whether we need any special handling for different fiber types.
Will start poking around the codebase this week and report back with what I find. If anyone has insights on the current scheduler internals or performance pain points they've seen, would love to hear them!