one small tip on this... if your up to creating custom objects.
if you take this part of the patch, and place it into an embedded sub-patch, you can then convert this into an object.
the code produced is not 'pretty', but sometimes is a good starting place for refactoring and generally rewriting with the optimisation required.
important note: just converting to an object will not bring any gains, the gains come from the C coding you then do to optimise the generated code. I dont want to start a rumour that subpatches should be converted to objects for improvements - it wont, and makes your patch much harder to edit later
(general coding tip: optimisations like this are always best done once the patch is 'stable' and unlikely to change)
a second, advanced tip, related to custom objects and code bloat, which in some case can bring a big reduction in code size.
axoloti inlines as much as possible, since it is after speed optimisation over 'space optimisation'. this is normally what you want for DSP, as its time critical. BUT if you have non time critical code, you can avoid this optimisation in 2 steps
a) put your function in header file
b) where you declare your function add 'attribute((noinline)) ' to the end
I consider this an 'advanced tip', so not going to say more, except you can see i do this on my Push object, so use that as an example.
just remember this is for non time critical code, e.g. initialisation, midi handlers, or other things outside the audio thread... if you dont respect this, you might get audio dropouts