zio icon indicating copy to clipboard operation
zio copied to clipboard

Implement NIO scheduler for ZIO

Open jdegoes opened this issue 1 year ago • 18 comments

https://nurmohammed840.github.io/posts/announcing-nio/

jdegoes avatar Nov 29 '24 02:11 jdegoes

/bounty $2500

jdegoes avatar Nov 29 '24 02:11 jdegoes

💎 $2,500 bounty • ZIO

💎 $10 bounty • petar

💎 $10 bounty • jairoemmanuelrojasramirez53

Steps to solve:

  1. Start working: Comment /attempt #9356 with your implementation plan
  2. Submit work: Create a pull request including /claim #9356 in the PR body to claim the bounty
  3. 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 bountyShare 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

algora-pbc[bot] avatar Nov 29 '24 02:11 algora-pbc[bot]

/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

ahmedtariqkhan avatar Nov 30 '24 16:11 ahmedtariqkhan

[!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.

algora-pbc[bot] avatar Nov 30 '24 16:11 algora-pbc[bot]

@maq796113: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Dec 07 '24 15:12 algora-pbc[bot]

@ahmedtariqkhan: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Dec 07 '24 16:12 algora-pbc[bot]

/attempt #9356

Options

promisingcoder avatar Dec 14 '24 08:12 promisingcoder

The bounty is up for grabs! Everyone is welcome to /attempt #9356 🙌

algora-pbc[bot] avatar Dec 14 '24 16:12 algora-pbc[bot]

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?

hp77-creator avatar Dec 23 '24 17:12 hp77-creator

/attempt #9356

Options

HollandDM avatar Dec 25 '24 10:12 HollandDM

/attempt #9356

Options

SAIKIRANSURAPALLI avatar Dec 31 '24 07:12 SAIKIRANSURAPALLI

/attempt #9356

Algora profile Completed bounties Tech Active attempts Options
@abdelfetah18 2 bounties from 1 project
Java, C++
Cancel attempt

abdelfetah18 avatar Mar 10 '25 17:03 abdelfetah18

💡 @abdelfetah18 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Mar 10 '25 17:03 algora-pbc[bot]

Is this still available?

Excellencedev avatar Jul 28 '25 10:07 Excellencedev

/attempt #9356

dohrisalim avatar Aug 19 '25 14:08 dohrisalim

/attempt #9356

parvit avatar Nov 06 '25 06:11 parvit

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

parvit avatar Nov 07 '25 07:11 parvit

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!

Geetk172 avatar Dec 06 '25 06:12 Geetk172