theme-ui icon indicating copy to clipboard operation
theme-ui copied to clipboard

Improve Spinner performance

Open lbebber opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. Right now, due to how the Spinner component is implemented, it increases the CPU usage, due to causing re-layouts on the page

(notice the layouts/sec and style recalc/sec measurements at the bottom, along with CPU usage at the top) Screen Shot 2021-03-04 at 22 53 14

This is because animating an element of an SVG triggers this event (at least on Chrome 88 on desktop) and is not (fully?) GPU accelerated.

Describe the solution you'd like A clear and concise description of what you want to happen. Spinning a DOM element--for example, an entire SVG element, instead of just a part of it--fixes this issue. Screen Shot 2021-03-04 at 22 51 41

This could be done without making any changes to the visuals of the spinner element as it is.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

lbebber avatar Mar 05 '21 02:03 lbebber

Thanks for the issue @lbebber! Great catch!

hasparus avatar Mar 07 '21 17:03 hasparus

:rocket: Issue was released in v0.15.5 :rocket:

hasparus avatar Feb 07 '23 22:02 hasparus