Solver getting slow with a large number of parameters

Hi Thomas,

I think 4 million parameters is quite a big number.
I guess the main overhead here is that we copy the parameter values into the function at every call.
This is done here:

So, this overhead should scale linearly in the number of solver iterations, the number of shooting nodes and the number of parameters.

I guess one could add some flag to the external function memory that indicates if the parameter values changed and have to be copied again.

Best,
Jonathan