Goz3rr / SatisfactorySaveEditor

293 stars 76 forks source link

Components with many children (ex. power circuits) considerably slow down the application #45

Closed budak7273 closed 5 years ago

budak7273 commented 5 years ago

Components such as Script > FGPowerCircuit > (a network) > mComponents can contain a large number of data tags, causing the program to slow down considerably. Perhaps they could be broken up into a series of 'show more's, or some optimizations could be made?

virusek20 commented 5 years ago

Are we talking about slowdowns during scrolling when the expander is open or the one time hang when you open the expander? Right now I have about 150 items in my mComponents and I have the one time hang, but not the other slowdown. I have to admit I spent more time making this editor than playing the game, how many connections does your save have?

As for the fixes, the "Show more" buttons could work, but I feel like it doesn't fit our scenario very well and it's already annoying as it is to find element 78 out of 150 without having to click "Show more" several times. I also tried "optimizing" the entire right pane a bit by virtualizing the UI, but I think that only helps the first issue, not the second one. The entire UI layout is a bit unfortunate in this regard too, because the entire 150 object array is a single row in the DataGrid and scrolling is managed by the container above. Letting the DataGrid manage scrolling isn't an option since that makes it snap to rows, which in our case don't fit the screen. Maybe it would be worth somehow restructuring the entire right panel, but I am honestly not sure how.

virusek20 commented 5 years ago

I think I found something actually. I can limit the height of a single row and get all the virtualization capabilities back that way, the downside is that we have nested scrollbars, which is a bit confusing for the user. It's basically the same thing as "Show more" except done by scrolling instead of clicking buttons. I'm gonna push a testing fix to a separate branch in just a moment, could you try it out on your save and tell me if it helped?

budak7273 commented 5 years ago

Your fix helped a lot - the component properties load instantly now and I get no delays at all when scrolling. I'll send you the save I was testing with on Discord in case you'd like to use it in the future.

It may be helpful to automatically expand the collapsed tags when they contain less than, say, 3 items.