When I press CMD+N in iTerm2 to bring up a new iTerm window, sometimes it takes 10 seconds before I get my prompt. If I immediately repeat the process, the whole thing takes 1 second. To me this implies it is a slow read of a file that is then cached in memory. I put a timing statement in my .bash_profile and that takes about one second, so it is not something I have manually and intentionally done to slow it down.
How should I find out where the time is spent during the shell/terminal initiation?
I tried running
sudo fs_usage -f filesys > fsusage.txt and then searching for
iTerm in the resulting file, but have not been able to determine what might cause the delay there.