RooFit coding for optimization of the fit

Hi RooFit experts,

I am writing a RooFit PDF code for Dalitz-plot analysis where I would like to implement some optimization to save CPU time. The idea is that because some internal variable used to calculate the Dalitz-plot PDF, such as Breit-Wigner amplitude for each resonance, does not change when varying the fitting parameters. So For a large number of dataset, one can save those information for every fitted data point to not cacluate them in every fitting iteration. But in RooFit, the evaluate() function in PDF is a general function regardless of if it’s fitted data points or not.

I am not familar with RooFit optimize function that might has implemented this idea. Please give your advice, thanks a lot!

Regards,
Liming