optimized version of grid_search + tests on speed of convergence