Working on Fix

Graph window using massive amounts of resources

Rimevel 3 months ago • updated by Lazlo Bonin (Lead Developer) 3 days ago 16 2 duplicates

After working for a while in the graph editor I get massive lag spikes very fequently that make it hard to work. Mouse clicks fail to register and drag operations fail as well. Did a profile on the editor and discovered this:

Duplicates 2

Under Review

Hi Rimevel, welcome to the community!

Thanks for your report.

I've seen this happen on bigger graphs as well. I routinely do an optimization pass on the graph window, but there is such a massive amount of GUI code in there that makes it hard to get a smooth 60+ FPS. It is definitely one of my priorities though. I'll add another bigger optimization pass to the roadmap in the 1.1 cycle.

It would help me if you could expand the OnGraphGUI node in your screenshot and show me what are the main culprits on your machine.

In the mean time, I can recommend to split your graphs into smaller nested subgraphs to reduce the amount of graph elements on screen at once.

I only have about 15 - 25 nodes at most at every level in my graphs. And this is on a powerful i7 + 1080 computer :P I will try to divide things up a little more.

This is something I noticed as well. Noticeably bad when game and graph windows are both open and visible. Both by themselves are pretty good actually.  If you work with prefabs... Forget about it! It's barely useable on a keyboard prefab I have. I'll try to profile in about an hour and post.

I do work a lot with prefabs.

That would be why. I try to always drop in my prefab and apply after changes. Works pretty good there, but can still slow down after awhile. I'm on a 16 GB ram, i7 1060 laptop. Shouldn't have a problem with power here either.

Not receiving anything ridiculous on a fresh restart. Even with prefabs. Most I am seeing is a 30fps drop on panning the graph view. Goes right back to 60fps though I notice after using for awhile. I will check again later after I've worked for a bit.

I got it wrong.

I thought it was slow because of the values component, but it seems that other Bolt related components may be a problem.

I can not open the Inspector.
Action is required.

I experience massive amounts of lag while panning a graph or moving a node. Drops to 5FPS. For some reason, this OnBeforeSerialize happens every 5 frames and seems to be the culprit.

So here's something odd... I discovered that Bolt's graph viewer only really slows down when the Unity Inspector is visible.

If I put the Graph Inspector on the same window as the Unity Inspector, then select the Graph Inspector tab (thus hiding the Unity Inspector), the framerate remains stable.

Hm, good catch, I'll investigate that. I believe that Unity tries to serialize/deserialize the inspected object at every frame whenever it is inspected for some reason. I'm not sure whether this is normal and by design or if Bolt's code is doing something wrong.

THANK YOU. I've been getting so frustrated with the massive input lag, it's been killing my productivity. This workaround helped me out big time.

me too…………But it's not sure what caused it.

run frames less than 5 frames
test game takes 10 seconds to open

When there is a large number of unit in graph, it will appear

if you minimze the both scripts "Variables", "Flow Machine" or "State Machine"... it works too...

Just a heads up: this is the main focus for the v.1.2.4 update. The graph window GUI code will be entirely refactored to maximize speed and minimize memory allocation in the editor. One important aspect of this refactor will be making sure that the amount of nodes in a graph becomes unrelated to the performance (e.g. having a 1000-nodes graph shouldn't be significantly slower than a 20-nodes graph).