Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runtime Optimization
Hello Smile

I'm trying to optimize Curvy as much as possible so it runs well also on lower-end platforms. I've been looking at the profiler and found some Curvy related updates:


All together they take around 2ms on my target platform.

I don't need to update anything at runtime (except moving PathControllers). The splines don't change. Generators don't change, don't need to regenerate.

I was wondering what I could do to reduce the footprint of Curvy as much as possible for this.

What I did so far:
- I turned off Auto Refresh for all Generators.
- I have the output of Generators as Static

Can I set a Spline to not update at Runtime? Is just disabling the component an acceptable way to do that?

Any tips would be very appreciated Smile

Thank you
In the 4 methods you listed, only CurvySpline.Update and CurvySplineSegment.Update are parts of Curvy Splines. Never heard of the other methods. So I will answer only regarding those two methods:

1- Splines do some checks every frames in their update method. You can disable the most costly checks by setting the "Check Transform" value in the inspector to false. The cpu cost of the remaining of the code is insignificant. 'You can't right now make the spline update method do absolutely nothing.
2- How many splines do you have in your scene? The mere existence of an Update method make Unity call it, and if you have thousands of splines (or other game objects with an Update method), just calling those methods, even if they are empty, will cost a little bit of CPU.
3-Are you profiling inside the editor or profiling the build?
4-In general, you can find useful performance tips here:

If by profiling the build, counting only the methods from Curvy Splines and disabling "Check Transform", you still find that the per frame cost of Curvy Splines is high, then please say so in this thread and we will together dive deeper in this subject.

Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
Wink Modifying Splines at Runtime artsung 1 7 01-30-2024, 09:40 AM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 4 01-30-2024, 09:30 AM
Last Post: _Aka_

Forum Jump: