Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Bad Performance in Build Mode
#7
(15-07-2021, 03:38 PM)josemendez Wrote: What are your project timestep settings? If the exact same rope runs in 0.8 ms in the sample scene but 80 ms in yours, makes me suspect that death spiraling might be the problem.

Look if FixedUpdate() is called more than once per frame in the profiler. That would mean adding the rope puts just enough strain on your scene to send the entire physics loop over the edge and start updating more than once per frame since it can't keep up with rendering.

Also, one thing I just noticed is that you have "Substep Unity physics" enabled in your ObiFixedUpdater, but you're not using substepping at all (just 1 substep/frame). This will make all physics in your scene appear under the ObiFixedUpdater() call in the profiler, as Obi is in charge of updating all physics in the scene when this is enabled. So these 9 ms in your original profiler pic account for the rope, plus all other physics happening in your scene. Not that it really matters, but can be confusing.
Ok, I think you are onto something here! I'm indeed in a death spiral. This is one frame without the rope:

   



and this is one frame with the loop enabled:
   

I'm not 100% familiar with the topic but I read a lot yesterday about how Unitys timing works but as I have a fixed delta time of 20ms configured thats the critical point I shouldn't exeed with my delta time. To be fair, with 15ms without the rope, I'm already not that far away from this point and when adding the rope I most certainly exeed this mark and fall into the death spiral.
As you can see I have changed the solver to execute on LateUpdate instead of FixedUpdate as rope is more or less of a cosmetic nature in my game so this should make no difference. This takes away some kind of processing while spiraling but of course isn't enough to stop the game from having more FixedUpdates than Updates.

What I don't get is, that regardless of any death spiraling, as you can see in the second screenshot the ObiLateUpdater.LateUpdate is taking 9.35 seconds is this a normal time for this kind of simulation? Or is this a side effect of the physics simulation being processed multiple times and without this happening this call wouldn't take that long? Because I totally that my frame times are going through the roof because physics is executed more than once but in case of ObiLateUpdater.LateUpdate it's just one execution that takes up half of my "target frame time"
Reply


Messages In This Thread
Bad Performance in Build Mode - by xeetsh - 15-07-2021, 12:58 PM
RE: Bad Performance in Build Mode - by josemendez - 15-07-2021, 01:08 PM
RE: Bad Performance in Build Mode - by xeetsh - 15-07-2021, 01:42 PM
RE: Bad Performance in Build Mode - by josemendez - 15-07-2021, 01:47 PM
RE: Bad Performance in Build Mode - by xeetsh - 15-07-2021, 03:20 PM
RE: Bad Performance in Build Mode - by josemendez - 15-07-2021, 03:38 PM
RE: Bad Performance in Build Mode - by xeetsh - 16-07-2021, 09:48 AM
RE: Bad Performance in Build Mode - by josemendez - 16-07-2021, 10:31 AM
RE: Bad Performance in Build Mode - by xeetsh - 16-07-2021, 01:46 PM
RE: Bad Performance in Build Mode - by josemendez - 16-07-2021, 02:30 PM
RE: Bad Performance in Build Mode - by xeetsh - 17-07-2021, 09:33 AM
RE: Bad Performance in Build Mode - by josemendez - 19-07-2021, 08:27 AM
RE: Bad Performance in Build Mode - by xeetsh - 26-07-2021, 10:15 AM