Hi Giulio,
I addressed both things that you pointed out in the last comment in the pull request.
How do you use the DDP solver in closed loop?
I think that actually, we did not really test it yet.
If you formulate your problem with translate_to_feasibility_problem(keep_x0=False), it is not possible right now to update the initial state. Or how did you do that?
Thus, you basically always solve the same problem over and over, if you keep_x0=False, which should then give you a very consistent timing.
On the other hand, your initial state update probably is correct when you set keep_x0=True and the differences in runtime correspond to the solver requiring a varying number of iterations. I suggest printing the solver statistics to evaluate this.
I think, we should set up a minimal example with closed loop DDP in acados for reference!