WooshiiDev / HierarchyDecorator

Lightweight Unity Plugin transforming the Hierarchy into what it should be. Adds headers, styles, icons and more.
MIT License
1.04k stars 49 forks source link

Bug - Performance degradation in play mode with many objects being activated/deactivated #62

Closed tivec closed 1 year ago

tivec commented 2 years ago

Current Unity version used 2022.1.6f1

Describe the bug In my game, I use an object pool for spawning bullets. When a lot of them are being spawned and despawned, the performance degrades significantly in play mode.

To Reproduce (If applicable)

  1. Spawn and despawn a lot of objects rapidly during play mode.
  2. Watch the stats screen in the editor.
  3. Add HierarchyDecorator.
  4. Repeat steps 1-2 and see the performance drop

Screenshots First video is without the HierarchyDecorator https://user-images.githubusercontent.com/717574/179356429-33b16cef-3aec-49da-bbec-4629e6ee3253.mp4

Second video shows With the HierarchyDecorator. https://user-images.githubusercontent.com/717574/179356498-5310ca1f-3107-4a68-8b37-c525c24b19ee.mp4

Additional context My laptop is unfortunately not a very strong one, but it is a significant difference between the two options.

WooshiiDev commented 1 year ago

Hello Tivec, it's been many months and I've been working on the codebase a lot to stop a lot of the performance problems.

Firstly, the main problem is the constant creation of icons each editor frame. This was negligble of me to miss and not realize, but has been worked on.

In the branch feature/new-icons-support I've been reworking the caching of icons and component data.

This is almost done, with the GUI near completiton. This will be moved to develop. If interested, you could test out the version on develop and tell me how it feels after I've merged it in.

Apologies that this has been a problem for many months now.