Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Frequent stutters and slowdowns even with simple ropes
#1
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]
Reply
#2
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?
Reply
#3
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.
Reply