graphql / graphql-playground

🎮 GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
MIT License
8.75k stars 730 forks source link

High CPU usage #320

Open schickling opened 6 years ago

schickling commented 6 years ago

This issue pertains to:

What OS and OS version are you experiencing the issue(s) on?

MacOS High Sierra

What version of graphql-playground(-electron/-middleware) are you experience the issue(s) on?

v1.3.6 (web)

What is the expected behavior?

The Playground should be friendly to my CPU 🤔

What is the actual behavior?

In some scenarios the CPU goes all crazy (sometimes above 80%). I couldn't exactly pin it down to a specific reproducible case but it's happening quite frequently. I suspect the Playground is "trapped" in some kind of infinite loop.

image

What steps may we take to reproduce the behavior?

Unfortunately I couldn't yet find a clear way to reproduce it. Would be great if other people can add more information!

Update:

I suspect it has something to do with errors (for example when the server returns an error)

filipe-q commented 4 years ago

Setting "schema.polling.enable" to false also worked for me

johannesmutter commented 4 years ago

My graphics card’s fans ran full speed when schema polling is enabled. This should be disabled by default, until it’s fixed. I looked into what’s the cause, and it seems it’s this tiny animation of the pulsing dot next to the address bar.

Disabling schema polling helps, but so does removing that little animation.

schema-polling-animation schema-polling-animation2 schema-polling-disabled
meastes commented 3 years ago

I ran into this as well. If you want to hide the dot, you can add this style to the page. This custom style will persist through reloads of your server as well.

[title="Polling Schema"] {
  display: none;
}