DamnWidget/anaconda — pull request #157 by rahul-ramadas (2014-05-03 23:43:11+00:00)
Title: Fix delay on first load

After opening Sublime Text, when I open the first python file, Sublime is unresponsive for approx. 1 sec. This seems to be because:

1. Anaconda tries to connect to the socket with a timeout of 0.5 sec, so if the server is not running, it waits 0.5 sec before giving up (unless the OS returns failure sooner, which in my case it doesn't).
2. After starting the server, it spins trying to connect, again with 0.5 sec timeout. I find that it is faster to attempt a connect with shorter timeout. It spins a few more times before connecting, but overall it takes much less time.

Of course, there is the small danger of false negatives (thinking server is not up, when it actually is), but I feel the improvement in responsiveness is worth it.