Setting up SSH multiplexing with ControlPersist[1] can help quite a bit here, since after the first connection you don't have to go through the init/connection phase for subsequent completions.
You can even preemptively fire up a master connection to commonly accessed hosts to avoid the initial delay.
Ah, that’s interesting! I assumed that something like that was going on, as subsequent completions take much shorter (in the same command), but I did not know about preemptively connecting to common hosts.
Thank you very much, I’ll try to play around with it :)
I'm guessing either they are using nis (which it often takes 20s for a passwd lookup) or they have done ~foo/<Tab> which needs to list the home directory; large home directorys on networks can easily take 20s for list.
Neither of those is what I was talking about though, as they aren't really part of the smart complete. To answer your question, I don't have an example, I just know that I tried ubuntu a while ago and smart complete would hang all the time. I don't currently have an ubuntu machine, so I can't try to track it down.