Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CurvySpline.Update() sorta expensive
#3
(04-27-2016, 06:54 PM)Jake Wrote: Ok, you're not the first one mentioning expensive Update() calls and while I'm still wondering about this, we need to discuss this in depth, I guess. Perhaps there's a bug or something else going wrong...

I made a quick test on my netbook I'm currently on. Fresh scene, created 10 different splines and duplicated them several times, giving me 120 splines. Default settings, nothing changed in the inspector. A quick profile gave me ~2ms for 120 Update() calls. That's quite much, but it's because of the default setting "Check Transforms", meaning all transforms of all CPs of all splines will get checked for updates each frame. If I disable that option, those 120 calls to Update() run at 0.2ms.

So, I really don't see the point in adding compile flags etc. to remove Update() calls or introduce other optimizations. Either you and others have several thousand splines floating around and/or are running on extremly slow hardware - OR - your profiling looks completly different and something makes that calls extremly expensive. Perhaps a certain setup, some added controllers or custom scripts or a bug that doesn't show up on my side while testing.

Don't get me wrong, I'd like to take that serious and investigate this. Many users have reported this, so there must be something going on. I just don't see it. Would you mind running the profiler and give me some details, perhaps you'd like to send me an example scene to jake<at>fluffyunderware<dot>com.

Ok so went back to my scene and changed all splines to Update and made sure Check Transforms is off, in my profiler I have 67 calls to CurvySpline.Update which ends up being .07 ms ... thats not too bad. I think the spikes I was noticing before are when GameObjects are enabled / disabled. In my game I've divided sections of the level that get streamed in and out depending on neighbor visibility. When one of these sectors with a bunch of curves is enabled, it racks up: 480 Bytes GC Alloc and .85 ms ... So probably was a mix of Check Transforms and enable / disable. I still think a No Update mode is a good idea, with it set to NoUpdate I get : 67 calls 0ms all the time, even when enabling or disabling any amount of sectors in my project.
Reply


Messages In This Thread
RE: CurvySpline.Update() sorta expensive - by invadererik - 04-27-2016, 07:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I have a question about curvySpline haifeng.huang 12 32 07-14-2023, 09:34 AM
Last Post: _Aka_
  "Deadloop in CurvySPline.Refresh" spam Valkymaera 3 11 05-30-2023, 10:56 AM
Last Post: _Aka_
  Calling Update with defined deltatime Marco Schultz 3 8 01-25-2023, 01:58 PM
Last Post: _Aka_
  I want SetLocalPositions to update all CPs at once. yanke 3 7 05-30-2022, 02:50 PM
Last Post: _Aka_

Forum Jump: