Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

The performance of applications is often a paramount concern for mission-critical systems. If your question pertains to execution-time optimization, whether it be database queries, algorithms, or anything that deals with speed or throughput, consider using this tag.

The two main measures of performance are

  1. Throughput (how many in a time frame). Example of units: transactions per second (TPS), megabytes per second (MB/s), gigabits per second (Gb/s), messages/request/pages per second.
  2. Latency (how long for an action). For example, seek time of 8  ms and search time of 100  ms.

Latency is often qualified with a statistical measure. Note: latencies usually don't follow a normal distribution and have very high upper limits compared with the average latency. As such the standard deviation is not useful.

  • Average latency. The average of all the latencies.
  • Typical or median latency. The mid-point of the range of possible latencies. This is usually 50% to 90% of the average latency. As this is the lowest figure it is often reported by vendors.
  • Percentile latency. The figure is less than or equal to N% of the time. That is, 99 percentile if the latency is not more than this, 99 times out of 100.
  • Worst or maximum latency. The highest latency measured.

When seeking to improve performance: prototype and measure first, optimize only if and where needed. A majority of languages have ways of profiling your code, which can help you determine which parts of your code take the most time to execute. For example, Python has several profilers, and a popular Java profiler could be JProfiler.

See also:

history | excerpt history