Hi,
I've been using the sqp optimization function, and I noticed that it makes a lot more objective function calls than it needs to, especially when no separate gradient function is supplied. This is problematic if the objective function is computationally expensive and/or has a lot of input dimensions. I've generated the attached diff file which removes redundant calls and otherwise leaves functionality exactly the same.
As this is my first contribution I'm not entirely sure of the process going forward, so please let me know if I need to take any other actions regarding this change.