custom-cards / slider-button-card

A button card with integrated slider
MIT License
105 stars 16 forks source link

High CPU Usage with Show Spinner = true #39

Open kenjfox opened 1 year ago

kenjfox commented 1 year ago

Checklist:

Release with the issue: V1.10.9 Last working release (if known): N/A Browser and Operating System: Chrome 107.0.5304.87 on Ubuntu 22.04 Chromium Browser Version 98.0.4758.141 (Developer Build) Built on Ubuntu 20.04, running on Ubuntu 22.04 (64-bit)

Description of problem: When focused, dashboard with single slider-button-card causes cpu to run at 24+%, compared with 5-12% for other dashboards. A view with 10 slider-button-cards uses around 40% cpu. I'm pretty new at using Chrome performance tools, but when I record the page just sitting there, it appears that it is repainting when it doesn't need to. This problem only occurs when the "show_spinner" attribute is set to "true".

image About every 15ms, it appears the same task is executed:

image

Here's the dashboard yaml: `title: Vango views:

The entity's state hasn't changed, so there shouldn't be any repaints needed.