react-native-macos icon indicating copy to clipboard operation
react-native-macos copied to clipboard

Resizing the window causes performance issues

Open ghost opened this issue 8 years ago • 4 comments

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.

ghost avatar May 25 '16 15:05 ghost

Thanks for creating the issue. I'm aware of this problem and I'm trying different approaches. What is your version?

ptmt avatar May 25 '16 16:05 ptmt

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 if inLiveResize == true?

jaredly avatar Apr 19 '17 18:04 jaredly

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?

ptmt avatar Apr 20 '17 07:04 ptmt

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.

jaredly avatar Apr 22 '17 03:04 jaredly