Currently, the optimization function is very slow. Probably it is possible to improve performance by rewrite it and use numba. More info: http://numba.pydata.org/