Skip to content

Terrible performance #1551

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

Closed
DanialLiu opened this issue Sep 18, 2019 · 1 comment
Closed

Terrible performance #1551

DanialLiu opened this issue Sep 18, 2019 · 1 comment

Comments

@DanialLiu
Copy link

I use kotlin 1.3.50 and coroutines 1.3.1 on android
this is my simple code

GlobalScope.launch{
            while(true){
                Log.i("tag", "default dispatchers")
                delay(1000)
            }
        }

CPU usage:
kotlin-coroutine

CPU usage will raise up to 30% every second

If I change delay(1000) to delay(10)
Every DefaultDispatch thread will cost more than 40% each CPU core
As the result of profile tool, most CPU waste in findTask
kotlin-coroutine-performance

Why the performance is so terrible?

@qwwdfsad
Copy link
Collaborator

It's a known issue #1046 which fix is targeted to 1.3.2.
Closing as duplicate

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

No branches or pull requests

2 participants