-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Visal debugging performance #799
Comments
Huge problem that name for entities generates every frame by ToString (5 problem in the list). This is first that need to be fixed. |
Out of curiosity, did anyone do some in-depth profiling to figure out what makes VD so heavy? A quick glance at the profiler seems to suggest ToString is the main culprit in our project (agreeing with @WeslomPo). Seems slightly strange, since ToString already has a cache built-in, and shouldnt be that expensive. The way we 'fixed' things in our project is by disabling VD, and have a button to enable to at runtime. It's a mediocre fix though, it would be awesome if there's a low-level modification to make it more performant with large amounts of entities. |
The cache for ToString is likely overwritten every frame if an entity changes at all, it has to walk every component and build a string out of all their ToString values. Just guessing here though, didn't look at the source. |
The bad boy is ToString() in Update(). Here is my solution: Source : Compiled dll based on 1.8.2 |
I tried not to change too much and do small improvements. By simply ignoring component.ToString(), which is probably not often used (e.g. |
Maybe setting a name when creating the entity would be more useful that displaying the components names? |
btw, the main reason I include all components is to able to search and filter entities |
Good post! There're only a few entities in my current project but every time I click on any entity the inspector will be frozen for half a minute, I guess these are related. |
What do you think about susing groups to choose which things get displayed? |
Hi, you might wanna pull from
I'd like to have some feedback from you guys, if the performance is better and if it's good enough, or if there are more areas that need opimization. Thanks! |
You're still able to use the hierarchy search and custom component.ToString() still works, but the overall performance should be way better now. |
Are you going to merge this into release in the future? Thanks for responding to this issue |
Yes, that’s the plan. I just wanted to hear feedback already because I don’t have projects where visual debugging is an issue. |
For your convenience, here' a precompiled version of the latest version incl. the Visual Debugging improvements: |
Any feedback welcome ;) |
Ideas / suggestions for a "performance mode" version of visual debugging (VD).
Problem: VD currently very demanding for a large number of entities due to the cost of creating and destroying the gameobjects used to represent them.
Here are a few of my thoughts:
Pool the gameobjects used for VD
Create only the root systems inspector gameobject by default then add buttons to "expand" or "collapse" sub-features which would create/destroy the child gameobjects that represent the sub-features (though i dont think systems profiling is the real culprit here)
Create no gameobjects for individual entities, instead, just use the single context gameobjects by default, list all the currently defined groups in the inspector, list their entity count, then provide a button to debug the group which would then create the gameobjects as usual, but only for the requested group. Remove the gameobjects again when the debug group button is unchecked.
Allow on-the-fly custom groups to be made and then debugged as in (3). This could perhaps be done by providing 3 arrays to fill, one of the components in AllOf, the second AnyOf and third NoneOf. Generate the group by assembling it from those pieces then provide the "debug this group" check box as before.
ToString() for every component to produce the name for the gameobject seems a bit heavy and wasteful, maybe there's a better way to search them, instead of using unity's string search field, perhaps we could use groups as described above instead. Then we could get rid of the need to ToString the entities to write their names out (again, no idea whether this is an useful optimisation or not, just thinking aloud).
Ideas / comments welcome.
The text was updated successfully, but these errors were encountered: