A particular program runs slowly

A program may start to run slowly for any one of several reasons.

Although this situation might seem trivial, there are still questions to answer:

  • Has the program always run slowly?

    If the program has just started running slowly, a recent change might be the cause.

  • Has the source code changed or a new version installed?

    If so, check with the programmer or vendor.

  • Has something in the environment changed?

    If a file used by the program, including its own executable program, has been moved, it may now be experiencing network delays that did not exist previously. Or, files may be contending for a single-disk accessor that were on different disks previously.

    If the system administrator changed system-tuning parameters, the program may be subject to constraints that it did not experience previously. For example, if the system administrator changed the way priorities are calculated, programs that used to run rather quickly in the background may now be slowed down, while foreground programs have sped up.

  • Is the program written in the perl, awk, csh, or some other interpretive language?

    Unfortunately, interpretive languages are not optimized by a compiler. Also, it is easy in a language like perl or awk to request an extremely compute- or I/O-intensive operation with a few characters. It is often worthwhile to perform a desk check or informal peer review of such programs with the emphasis on the number of iterations implied by each operation.

  • Does the program always run at the same speed or is it sometimes faster?

    The file system uses some of system memory to hold pages of files for future reference. If a disk-limited program is run twice in quick succession, it will normally run faster the second time than the first. Similar behavior might be observed with programs that use NFS. This can also occur with large programs, such as compilers. The program's algorithm might not be disk-limited, but the time needed to load a large executable program might make the first execution of the program much longer than subsequent ones.

  • If the program has always run slowly, or has slowed down without any obvious change in its environment, look at its dependency on resources.

    Performance-limiting resource identification describes techniques for finding the bottleneck.