-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] Inspector lags severally #133
Comments
Thanks, I'll look into it. |
@dbrizov have you gotten to look into that issue ? |
I haven't |
Hi, same problem here, but it only happen with BoxGroups |
I have a similar case in a project where everything is becoming extremely unresponsive. Looked into the profiler and noticed a couple of naughty attribute calls seemly causing a big junk of it... (been on 2019.3.13 and updated to 19.3.15 today) |
@marwie I was looking at this issue my self today and trying to find simple workaround in the editor. It seems there are many calls to fx ReflectionUtility.GetAttribute which in some cases (at least for ShowIfAttribute) are not needed and can be kept and then reused in the call. I also looked into creating delegates for the calls since they do not change between conditionName setting on the attribute. This sped things up. Some of the garbage collection seems to come from Unity propertdrawing itself, I have yet to look deeper into that |
Hey, just wanted to say that I'm also testing NaughtyAttributes (v2 branch) on Unity 2019.4.2f1 (LTS) and experiencing severe slowdowns when using ShowIf+BoxAttribute BTW: I'd gladly pay for having full support on the Unity Asset Store - I wanted to use ODIN while working in my company, but apparently it costs 250 bucks - per seat - and there's only me actually accessing it! Any chance of using some caching system to speed up the rendering? |
Hey mate, I am doing my best to update as frequently as I can. I'm pretty busy the last couple of months, and I am trying to chill in my free time. I am trying to address and fix the issues that people report every month or two. I have it planned to look at the slow down for the next release. Fortunately, the issue is related to the conditional attributes mostly (ShowIf, EnableIf), so it might not be that hard to fix. I have to cache things, because the reflection is heavy there. |
Also check ReadOnly attribute |
Confirm still happening. I have this issue also. It makes the game lag if I select the component with naughty attributes in the inspector. It seems any attribute causes this issue. For example if I enable |
@dbrizov any update? |
@snorrsi No, I haven't done anything about this, it's not a priority at the moment. However, I tested some months ago with the current Unity version and with 2018.3. With 2018.3 there are no performance issues. The new UI system is heavier than the previous one, and the Unity docs state that the new UI Elements system is more optimized. |
@snorrsi Hey folks, The main issue is getting attributes (expensive Reflection) per property on every on inspector gui call, aswell as fetching every serialized property in this call. Ill create a fork and test around a bit but the idea is to fetch all the required stuff after compilation (OnEnable) and not on every call and refactor the methods, that fetched the attributes like "IsVisible" and "IsEnabled" etc. Its still not perfect and not every case is covered (since I was focusing on mine) and testing + refactoring needs to be done but thats a huge boost on my machine! So lets see how it goes... |
Here is the result of my current attempts at: Old Issue: Fix: The downside to it is, that it caches all scripts in unity after compiling. I think a better attempt is to cache them on the current opened inspector and cleanup after leave... |
…y improve the gathering of the required properties and attributes
There is a pull request that caches a lot of things to minimize runtime reflection. |
@dbrizov why is this closed if the pull hasn't been merged? .. Are you planning on merging that pull request at some time ? |
bump |
I use NaughtyAttributes for Small Repos and for Complex projects, I use Odin. I avoid Odin since it is too much for small projects.
Now I am using NaughtyAttributes for a class with around 25-30 variables serialized in Inspector. There are few sliders and few headers. I am using 2019.3.3. Now since I upgraded from 2019.2 to 2019.3 the editor lags severally if I select this object in scene which has this class with many exposed variables. To confirm the issue I removed NaughtyAttributes using in the class and commented the Attributes and speed is increased. I switched to Odin to avoid this lag and in Odin there is no lag and has natural speed.
I checked profiler when using NaughtyAttributes and is shows EditorLoop as 80% which is huge. To playtest I have to use Maximize On Play to avoid editor lag.
I am pretty sure that NaughtyAttributes is doing some stuff which is making Unity editor so laggy. I think I have never encountered such issues when using NA earlier and I think it has something to do with newer NA v.2.0+ paired with 2019.3 and a variable heavy class.
I hope you fix it soon.
Thank you
The text was updated successfully, but these errors were encountered: