Obi Official Forum
Help Frequent stutters and slowdowns even with simple ropes - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Frequent stutters and slowdowns even with simple ropes (/thread-2157.html)



Frequent stutters and slowdowns even with simple ropes - SpiralCircus - 10-04-2020

I've noticed a really prominent stutter that can be traced to the Obi fixed updater. It's irregular but frequent. The execution time of the fixed update method runs up to 32ms during these spikes.

This occurs even in a completely empty scene with one solver and one rope, with only roughly 50 particles (see particle renderer in the image for particle density). The solver is set to default settings. The updater is also at default settings, with SubstepUnityPhysics set to false, and the blueprint is simply two points, with each control point attached via a static attachment point to gameobjects in the scene.This is about the simplest setup I can imagine for a rope. So i would expect that it would run smoothly on a fast desktop machine.

Unity physics and timestep settings are all set to default, and these cpu spikes are visible both when running in the editor and a standalone windows build.

Is there anything you can suggest to help get rid of this?

[Image: WvdPiZq.jpg]


RE: Frequent stutters and slowdowns even with simple ropes - josemendez - 13-04-2020

Hi there,

I'm unable to reproduce this. This is how the profiler looks like simulating a single short rope for me:

VSync On:
[Image: XgQmNbJ.png]

VSync Off:
[Image: v5YJ3TG.png]

No spikes whatsoever. Similar behavior in Windows 7, macOS Catalina and Ubuntu Linux.

Internally Obi uses a thread pool to implement a task scheduler. Threads need to be woken up when new tasks are available, the time taken for a thread to go to sleep is dynamically adjusted based on the workload (more work, more idle time before going to sleep). Might be that in your architecture, threads take longer to be woken up after being put to sleep, but without more info that's just a shot in the dark.

What Platform, CPU, Unity and Obi versions are you using to test this?


RE: Frequent stutters and slowdowns even with simple ropes - SpiralCircus - 13-04-2020

This is the strangest thing: I reopened the test project after reading your message to see if i might have done anything silly. The spikes were gone completely. Nothing else had changed except my machine had been shut down and restarted.

My only thought here is that there was something going on in another process on my machine that was interfering with the available threads. While it's gone please consider this topic closed. I'll post in here again if it returns in any kind of reliable way.

Sorry to take up your time on this.