A full strace run prints thousands of lines that are hard to read. When you only want to know what a slow program spends its time on, a summary is more useful.
strace -c -f ./slow-script.sh
The man page describes -c as counting time, calls and errors for every system call and printing a summary when the program exits, instead of the normal output. -f follows child processes, so commands the script starts are counted too. The table shows the share of time, the total time, the average per call, the number of calls and errors, and the name.
The errors column is often where the story is. Thousands of failed openat or stat calls mean a program searches many paths for a file or library. Lots of futex or poll time points at waiting rather than working.
By default the table measures system time, which leaves out time spent waiting. For a program that is slow because it waits on network or disk, add -w for wall clock time instead:
strace -c -w -f -p 1234
With -p you attach to a running process; stop with Ctrl-C to see the table. I’d sort it with -S calls when the number of calls matters more than their time.
strace slows the traced program down noticeably, so absolute times are inflated. Compare the shares, not the seconds. Attaching to another user’s process needs root, and many systems also restrict tracing through the ptrace_scope setting.
Further reading: strace(1) manual page