mob-sakai / SoftMaskForUGUI

Enhance Unity UI (uGUI) with advanced soft-masking features to create more visually appealing effects!
https://github.com/mob-sakai/SoftMaskForUGUI
MIT License
2k stars 262 forks source link

Performance Problems on larger hierarchies #56

Closed mszkopinski closed 4 years ago

mszkopinski commented 5 years ago

Hi, I am using your solution, which is by the way really great and it really fits my needs, on large UI hierarchy in a mobile game, swipeable collection of cards precisely (which is optimized from the structural side of things). I was profiling the game on android device yesterday and there were a some GC (bit smaller beacuse I've optimized GetComponent calls and more caching where possible) spikes and a big overhead caused by Unity internal layout update (it's like thousand of ms when using deep profiler). Let me visualise the case

Have you some advice how is it possible to optimize this case (i.e. using less SoftMaskable components)? I would be really grateful.

I am using Unity 2017.4.22f1 and newest versions of your components.

mob-sakai commented 5 years ago

@mszkopinski Thank you for using my asset. :) Can you attach a minimal repro project for this issue? It helps to solve this issue.

mszkopinski commented 5 years ago

To be honest I can't because it's a highly commercial project. It would be great if you just try to check components (with attached profiler) on bigger hierarchy. Is it all the stuff with clearing _softMask in OnEnable, OnDisable necessary? Maybe there's something you missed or didn't test or there's problem with my certain layout, hmm. Any help would be appreciated and sorry for not attaching repro but you know... non-disclosure agreement.

mob-sakai commented 5 years ago

@mszkopinski Ah, I see. I just want to know more about "a large hierarchy" you are talking about.

  1. Duplicate a scene with "a large hierarchy".
  2. Remove the components and assets that can not be disclosed from the scene. Instead, use built-in assets or assets that can be disclosed.
  3. Export the scene as unitypackage.
  4. Zip the unitypackage.
  5. Attach the zip file here.
mob-sakai commented 4 years ago

I am closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it is an enhancement and has not been taken on for so long, then it seems no one has the time to implement this.

Please reopen if you still encounter this issue with the latest stable version and then please use the issue template. You can also contribute directly by providing a patch. :)

Thank you!