my extra long bash prompt

More than a usual amount of CPU time is spent generating my shell prompt:
export PS1='!\! $(if [ "\j" = "0" ]; then echo -n; else echo "[\j] "; fi)\u@\h:\w$(output-git-head-or-blank)\$ '
with output-git-head-or-blank being a simple script:

#!/bin/bash
PS_GIT=$(git-symbolic-ref HEAD 2>/dev/null) && echo " #$(basename $PS_GIT)" && exit
# else output nothing