Optim: small optimizations

On the digits example, on my computer, these changes improve the run time
of t-SNE from 22s to 18s.
Merge branch 'pr_2822' of https://github.com/GaelVaroquaux/scikit-learn into GaelVaroquaux-pr_2822

Conflicts:
	sklearn/manifold/t_sne.py
Merge branch 'GaelVaroquaux-pr_2822' into tsne