Debounce the resize event handler #19612
Atom is currently listening to window
In order to do so, the
All this processing usually takes 2-5ms on my high end machine, but under some circumstances (don't know what triggers it) it can take 40-50ms (or even up to 200-400ms, for example on Electron v4 because of electron/electron#19027). These times are way above the frame budget and cause very noticeable lagging on the UI when resizing.
The solution is a one-line change: just using a simple debouncer to only store the windows dimensions when the resizing has finished makes the UI lag-free.
Here there's a comparison video between current master and this PR, to see the noticeable difference (I didn't upload a