I didn't read every post here, but I'm gonna post a technique for debugging slow startup just in case no one else has posted a good one yet.
If you install the moreutils
package, you'll have a timestamp command called ts
. You can use it to print sub-second resolution timestamps of all of the debug output from zsh that tell you how long since the last line of output. You can then search that file for timestamps that are "long". Here's the command:
zsh -xv 2>&1 | ts -i "%.s" > zsh_startup.log