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

[scheduler] cats-effect integration #909

Merged
merged 1 commit into from
Dec 9, 2024
Merged

[scheduler] cats-effect integration #909

merged 1 commit into from
Dec 9, 2024

Conversation

fwbrasil
Copy link
Collaborator

@fwbrasil fwbrasil commented Dec 7, 2024

Benchmark results are mixed but use in realistic workloads might yield significant improvements, especially in containerized environments given Kyo's adaptive concurrency control.

image

@@ -41,6 +41,14 @@ object Task {
val Preempted: Result = true
val Done: Result = false

def apply(runnable: Runnable): Task =
Copy link
Collaborator Author

@fwbrasil fwbrasil Dec 7, 2024

Choose a reason for hiding this comment

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

I inspected SchedulingBench, the top benchmark with regression, and noticed that we can avoid an allocation with this dedicated constructor. I also noticed that IOFiber has a few hot code paths with special treatment for the default work stealing thread pool, which should account for some of the regression with a custom thread pool.

Copy link
Collaborator

@hearnadam hearnadam left a comment

Choose a reason for hiding this comment

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

LGTM! Can we create a simple mechanisms for users of kyo-zio and kyo-cats use the scheduler? Should those modules depend on the related scheduler modules?

On second thought, do we even need separate modules? Can we just compile the scheduler code for scala2/3 and the effect interop for scala 3?

@fwbrasil
Copy link
Collaborator Author

fwbrasil commented Dec 9, 2024

LGTM! Can we create a simple mechanisms for users of kyo-zio and kyo-cats use the scheduler? Should those modules depend on the related scheduler modules?

On second thought, do we even need separate modules? Can we just compile the scheduler code for scala2/3 and the effect interop for scala 3?

The goal of the separate artifact is to allow adopting Kyo's scheduler in isolation without the effect system. If we merged the modules, it wouldn't be possible to provide Scala 2 artifacts as well. I think we can address this via documentation mentioning that users can use KyoSchedulerIOApp to enable Kyo's scheduler in addition to the regular integration APIs. I'm not sure there's much more we can do other than provide the App super class injecting the scheduler automatically.

@fwbrasil fwbrasil merged commit d534d3f into main Dec 9, 2024
3 checks passed
@fwbrasil fwbrasil deleted the scheduler-cats branch December 9, 2024 22:22
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.

2 participants