+4
Fixed

Performance drop when dragging

3d_Artist 2 years ago updated by Alexander Antonov 2 years ago 38

Hey,

Unity 2018.2.6 with bolt in editor so lagging performance while editing graph.

Anyone facing this issue?

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by 3d_Artist 2 years ago
Pending Review

Hi 3d_artist!

Is this an issue that started with Unity 2018.2.6? Did you have it with previous version of Unity?

The Bolt graph window is highly optimized, but maybe something changed in the underlying Unity API.

Hi,

Thanks for response.

I don't have Older version.

But i will download & get back to you.

i have kind of the same problem with 2018.2.5.

But i'm also working on a large project with a lot of 3rd party assets and custom scripts. 
When i edit some small macros its okay, but when i want to edit my manager flow macro it's so slow i can't even drag to create a group in my flow machine.

Hey,

2018.1 don't have issue but when in new unity 2018.2.6+ its become jerky performance in editor.

@3d_Artist are you using Unity Collab?

Just tried to update to 1.4 from the Asset Store and having the flow Flow Graph editor be laggy. It stutters then's fine then stutters again. 

Not had this issue before 1.4. I'll do some more testing but ALSO not a 2018 thing for me as I am using 2017.4.3f1

Edit: Just tested with a new project with only Bolt installed. Still get the stutter in Flow Graph Editor. 2017.4.3f1

Will carry on testing.


Can confirm the behaviour of intermittent stutters on the as of now latest 2018.2.8. And it's been happening since the last bolt update.

Confirmed the stutter when dragging elements in the Flow Graph Editor with a new project on: 

2017.4.3f1

2018.2.8f1

The stutter seems to be worse the more units are in the Flow Graph. 

Middle mouse button pan graph seems to jump around while multiple click dragging (assuming its the lag messing with the position of the mouse).

2017.4.3f1 with Bolt 1.3 with large graphs have no lag for me. 

Hope this help!

Does the Unity application memory usage over time increase for you? Because it does so for me, till I run out of RAM.

wow srijanvoidsys, yeah it does.

Only goes up when Flow Graph is open from what I can tell.

Increases about 1-10MB a second when interacting with the Flow Graph.

Clicking off Unity to type this with the Flow Graph Open the memory is not going up. 

Also looks to use more memory the larger the Graph. 

Just a shot-in-the-dark hypothesis here:

1. Does this only happen on embed graphs, or also macros?

2. If it only happens on embed graphs, does it go away if you close or hide the Inspector window?

In my case macros.

This seems to happen with both Macros and embeded graphs. Selecting them in either the project panel or on objects themselves.

The memory goes up faster while interacting with the Flow Graph. 

Dragging items and middle click dragging of the graph increases the memory usage jumps. 

If left open but unused the memory goes up more slowly. 

The size of the graph also makes a difference. 

A very simple graph lags less and the memory goes up slowly. A large graphs makes the memory go up in larger jumps.

Thanks. 

Also, playmode for me seems to reset the laggyness but after a few minutes left in playmode with the graph editor window selected the graph gets super laggy (a large graph) the longer its left the worse it gets. 

This is with an empty scene in an empty project, only Bolt installed, unity 2017.4.3f1 running nothing in play mode. The graph I am selecting is a macro in the project panel so isn't running.

Also got a unity error the second time I tried to run play mode after the graph got really laggy. This is with an empty project and scene. Bolt isn't even in the scene.

Error message: Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)



I downgraded Bolt to 1.4.0.f5 and everything works perfectly fine.

Quick question that may not help, but I had the same issue. Have you tried using the force opengl trick? https://answers.unity.com/questions/447206/forcing-opengl-in-windows-editor.html


This can cause Unity to run smoother and helps me everytime I update Unity and I think bolt is running slowly.

Thanks for the suggestion Sam but no difference for me with OpenGL. I think it's more fundamental than a graphics issue.

Hi everyone,

Thanks for the reports, but I need more information to pin down what's happening. As always, you should include:

  • The Bolt version
  • The Unity version

Since one of you reported it worked in 1.4.0f5, I'll see if I might have introduced a performance regression in f6.

I'm testing 1.4.0f6 with Unity 2017.43f1

I've also tested 1.4.0f6 with Unity2018.20f2 with similar results.

Edit: my current project is running Bolt 1.3.0  with Unity 2017.43f1 without any issues (Bolts great btw loving it allot)

Hey all!

So I'm investigating this and I think I found a few causes. In order of importance:

  1. Unity repaints the graph twice per frame when dragging. This is due to how their immediate mode GUI is structured. UIElements is a complete overhaul which fixes this obsolete non-event-based way of doing things, but until that's stable, we're stuck with IMGUI. I'm currently trying to optimize the canvas rendering so that it skips any operation it can afford to during a MouseDrag event. There's no easy one-liner solution though, because each part of the code has to be fragmented to account for that.
  2. There's a bug (#2188) that causes a memory leak in play mode. It was introduced in v.1.4.0f6 and will be fixed in v.1.4.0f7.
  3. There's always some memory allocation in the editor, with or without Bolt. Standard GUI calls like TextField and EnumPopup allocate memory; I can't do anything about that. You shouldn't worry about editor-only memory allocation.

Thanks for the update Lazlo.

Would point 1. explain why the lag isn't in older versions of Bolt?

I don't think so. In fact, it should have been worse in previous versions (pre-1.4), because 1.4 had a major rewrite to optimize graph rendering speed. 

The only thing I can think of is that the sidebar has to be redrawn on drag too in 1.4 (there was no sidebar in 1.4), so if you have a lot variables for example, it could  contribute to the slowdown.

I have 2 variables in the test graph I ported from my main project so I can't imagine that would be causing it. There's still a noticeable lag every few seconds when middle dragging and making connections between nodes. 

Is there a place for me to grab 1.4.0.f5 and test that out?

So I've done a good round of optimizations. Not quite ready for release yet (some testing left!), but the results are very promising!

Render Time Per FrameMemory Allocation Per Frame
1.4.0f6 Idle16ms104 KiB
1.4.0f6 Dragging48ms748 KiB
1.4.0f7 Idle12ms65 KiB
1.4.0f7 Dragging14.5ms80 KiB

Will finish this up on Monday!

Great, thanks Lazlo, not in a major rush as 1.3 is still working great for me. But would be nice to get some of those sweet sweet upgrades from 1.4 :)

Thanks lazlo, lifesaver for me.

+2

Couldn't finish in time for today, but 99% sure I will tomorrow.

The good news is that I went even further than the optims I mentioned last Thursday. The graph window now feels buttery smooth under all circumstances, even huge graphs.

Wow, Look Great!

Fantastic! Where might I find the Hotfix? 

Pushing it to the downloads page and asset store within the hour!

I've noticed that performance was bad too, but somewhy was lazy to report it:( 
Now it's much better. Great, thanks!

+1

Just want to say thanks Lazlo! It's a big difference, it really feels nice now. Buttery smooth is correct!

amasing update . it was increasing memory usage up to 5 gb just cos of open graph editor / needed to restart unity  .  now not more then 1gb stable on the same proj. ty

+1

if you are experiencing lags with unity editor ui in general, lower your mouse polling rate when in unity