Skip to content

The Polling System CPU overhead #4328

@DeviLab

Description

@DeviLab

The new polling system looks interesting for the cases when there are libraries which use it, but when I updated my app to CE 3.6, I faced a significant CPU increase (more than 70%). According to the profiler it is caused by EPoll-related calls from the Cats Effect code. When I overrode the polling system to SleepSystem in the main class the problem has gone and the CPU consumption was back top normal:

import cats.effect.unsafe.{PollingSystem, SleepSystem}
....
object Main extends IOApp {
    override protected def pollingSystem: PollingSystem = SleepSystem
    .......
}

Thare are still a lot of apps and libraries which use the polling mechanisms directly and can't be re-implemented to use the new feature. It means that users can see some performance degradations just because they bumped Cats Effect to 3.6. Do you have any ideas how this issue can be addressed? Does every app which doesn't rely on the polling system require such explicit change?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions