react-native-macos
react-native-macos copied to clipboard
Resizing the window causes performance issues
There are performance issues when resizing an app created with react-native-desktop.
I created a basic app with an image consuming the full view available in the app, when I resize the window there is a lag in the view. The view does not resize as quickly as the app window.
I have been able to reproduce the issue on the UIExplorer app as well.
Thanks for creating the issue. I'm aware of this problem and I'm trying different approaches. What is your version?
I'm on latest and it looks super janky. thoughts I've had without digging into the code too much
- the minimum would be: don't resize the window frame before the contents have reponded. This is what e.g. xcode, google chrome do. currently RNmacos has the window frame resize smooth as butter, but then it looks super bad b/c the contents are behind.
- are we perhaps trying to send a ton of
onLayout
events to the js size during live resize that we could skip ifinLiveResize == true
?
It's the most important single issue, apart from the overall lack of stability. I hope after merging with the latest yoga I would be able to profile and find bottlenecks. My previous guess was AppKit can't handle so many views well, but turns out it wasn't exactly true https://github.com/ptmt/appkitbench
the minimum would be: don't resize the window frame before the contents have reponded
Could you please elaborate?
Could you please elaborate?
If you take a "google chrome" window and resize it quickly, you'll see that the window frame lags behind the mouse a little, and appears to debounce. This way, the contents is always in sync w/ the frame -- but the frame is not 100% in sync w/ the mouse With this project, the window frame is always 100% in sync w/ the mouse.