In bash, run echo $$ to see the shell's process ID, then get ready to press Tab in bash. Open another terminal and run strace -p1234 where 1234 is the process ID of bash. strace will print a trace of the system calls that bash executes. Even if you don't understand exactly what is going on, this is often enough to understand what is taking time — typically it's making a network request, or it's accessing a very large number of files. Figuring out what settings to change to avoid the slowness may or may not be easy.
Depending on your system's security settings, you may not be allowed to run strace on an unrelated process. If you aren't, then run strace as the parent of bash:
strace -tt -T -o bash.trace bash
Do the completion attempt then exit bash and look at the trace file bash.trace. Each line has a timestamp at the beginning indicating when the system call started, and the number in angle brackets at the end of the line is the time spent in the system call.
strace is a Linux command. If you aren't running Linux, look up the corresponding command on your system — dtrace, truss, trace, …