What's new

Best practices for CPU %

maxchristensenaudio

Observant Sound
Hi, I'm currently working on a pretty hefty beast of a library right now and I'm a bit worried about it being too CPU hungry for some systems.
I'm developing it on a M1 Chip Macbook Pro and just from playing 1 note the CPU spikes at around 14% with all FX enabled.
Just now I've realized that I probably need to double the Plate Reverb and legacy delay send effects to achieve the kind of behaviour I'm after.

I would love to hear any tips from more experienced developers regarding performance, what to look out for and also, how to tell my users what minimum specs will be able to handle the library!
 

EvilDragon

KSP Wizard
You can't really know minimum specs without testing out your library on a multitude of systems of various configurations...

In a nutshell, all the new FX in K6 are more CPU demanding than older FX (especially Replika), convolution and AET filters are also demanding (in convolution this also depends on the length of IR sample you're loading in), and new K5 filters do require more CPU than old ones, especially ladder and Daft.
 
OP
maxchristensenaudio

maxchristensenaudio

Observant Sound
Thread starter
  • Thread Starter
  • Thread Starter
  • #3
I'm actually just using the plate reverb and legacy delay because you're right in that the new ones really shoot the CPU through the roof. Didn't actually know that the ladder filters were more CPU intensive. I thought we had them on K5 as well?

2 1/2 follow up questions:
- How likely is it that less efficient code (lets say a few hundred or 1000 extra lines of unneded code) impacts CPU performance? I know the code should be as efficient as possible also for the coder but this is probably not the first place to look to reduce CPU performance right?
- Say I don't have a multitude of systems for testing: Do I just sell the library without any mentions to system specs, and offer refunds for people whoose system can't handle the library?
- - Is this something that the pulse download team would handle as well?
 

EvilDragon

KSP Wizard
I thought we had them on K5 as well?
Yeah we did. CPU-wise it's a comparison with legacy <=K4 filters.

- How likely is it that less efficient code (lets say a few hundred or 1000 extra lines of unneded code) impacts CPU performance? I know the code should be as efficient as possible also for the coder but this is probably not the first place to look to reduce CPU performance right?
Yeah probably not too terrible, in most cases. You wouldn't get much CPU savings there, unless you're doing something really really crazy.

- Say I don't have a multitude of systems for testing: Do I just sell the library without any mentions to system specs, and offer refunds for people whoose system can't handle the library?
This is why beta testing exists where you send out your library to various people and gather feedback on how it performs :)

- Is this something that the pulse download team would handle as well?
Unsure, but probably not.
 

berto

Active Member
check the ON Listener lines and as Evildragon once suggested , make it work only when needed with if statements...

and if you have convolution IRs that are too long, well that's a problem...
 
OP
maxchristensenaudio

maxchristensenaudio

Observant Sound
Thread starter
  • Thread Starter
  • Thread Starter
  • #7
check the ON Listener lines and as Evildragon once suggested , make it work only when needed with if statements...

and if you have convolution IRs that are too long, well that's a problem...
which comment about ON Listener are you referring to berto?
 

Vartio

Active Member
Use legacy filters where ever possible. I've made a rule of swapping any other filters to legacy in kontakt. Especially when used on groups the filter cpu hit can multiply very quickly. Theres a small difference to the sound (in context it's nothing I cant live with, besides if the filter sweep is the main event, I'll use a proper plugin for that on the channel) but it keeps the cpu happy!
 

berto

Active Member
which comment about ON Listener are you referring to berto?
if you have anything in the LCB that refers to syncing, timing, or anything that happens at every specific time, make it work only when needed. Like if KSP has to adapt to a BPM change, make it happen only when there is a BPM change, so that it does not check all the time for a BPM change.
something like this (as per Evildragon's suggestion in another thread)
on listener if ($DURATION_QUARTER # $prev_quarter) if ($NI_SIGNAL_TYPE = $NI_SIGNAL_TIMER_BEAT) call time_set {adjust all timings and durations} $prev_quarter := $DURATION_QUARTER end if end if end on

Also if Kontakt CPU usage is not zero when idle (no transport running, no note input) then something is not right in the script (most probably the LCB)
 
Top Bottom