kano-code icon indicating copy to clipboard operation
kano-code copied to clipboard

Clock part periodically triggers large editor repaints

Open keithclark opened this issue 5 years ago β€’ 0 comments

When adding a clock part to a creation the preview stutters once a second. This is really apparent on lower-end hardware, like the PI3 Kits. Adding another clock makes the problem worse.

Devtools shows the clock part is triggering a complete repaint of the block editor whenever the inline <kc-clock-display> component updates (see the gif below. I wish GitHub would let me upload videos!). Profiling this on the PI3 kit points to these repaint as the cause of the stuttering.

paint-flash

To prove this I added position: absolute to the <kc-part-item-list> elements to prevent them from triggering reflows (and also breaks UI layout). This limits repaints to the correct areas and the PI happily ticks away at a constant frame rate...

paint-flash-fix

This paint flashing also happens briefly when switching to the part rename control, so this may not be limited to the clock part.

keithclark avatar Jan 16 '20 18:01 keithclark