Measuring Software Performance
-
Define the Operation Before Timing It
A timing report needs to state what work starts and ends the observation. Seemingly similar measurements can cover different stages.
-
Interpreting Elapsed and CPU Time in a Benchmark
Elapsed time includes waiting. CPU time reports how much execution was charged under an operating system's accounting rules.
-
Measuring Throughput from Completed Work
Throughput counts completed units per time interval. Submissions and queued tasks measure demand rather than delivered results.
-
Latency With and Without Queue Delay
A request's elapsed time may include waiting before processing starts. Measuring both intervals helps identify the dominant cost.
-
Comparing Typical and Slow Request Durations
A median describes the center of an ordered sample. Higher percentiles describe portions of the slower end under their chosen definition.
-
How Equal Mean Latency Can Hide Different Experiences
Time samples with the same mean can have very different spread and slow-case behavior.
-
Warm-Up and Cold Start in Measurements
Initial work can involve loading data or preparing execution. Later operations can reuse that work, changing what a benchmark measures.
-
Warm and Cold Data Access
A measurement can reuse cached data or wait for a lower-level source. State which data locality the workload represents.
-
Timing More Than One Input Size
Measurements at several input sizes help distinguish work primarily driven by fixed overhead from work growing with the input.
-
Repeating Short Measurements
Short operations may be comparable to timer or scheduling noise. Repeated measurements can reveal the range and reduce sensitivity to one observation.
-
Timings and Operation Counts as Complementary Evidence
An operation count explains a model of scaling. A timing observation captures a particular runtime, workload, and hardware environment.
-
Reading a Sample-Based CPU Profile
A sampling profiler periodically observes where execution is active. Frequent sampled stacks can suggest which portions account for CPU work.
-
Inclusive and Self Time in a Call Report
Inclusive time includes work in called routines. Self time attributes work directly to the measured function under the profiler's definition.
-
Peak Retained Memory and Total Allocation
Peak retention concerns how much memory stays live at once. Total allocation can grow through objects that are quickly discarded.
-
Tracing the Stages of an End-to-End Request
A request trace can associate stages and elapsed intervals with one observed operation so repeated slow paths can be inspected.
-
Choosing a Representative Benchmark Workload
A useful benchmark matches the proportions, sizes, and access patterns relevant to an actual question.
-
Comparing Changes Under Similar Conditions
A before-and-after comparison should vary the implementation while keeping the task and relevant measurement environment comparable.
-
Throughput as Worker Count Changes
Adding workers can increase capacity, but shared resources and coordination can limit the added throughput.
-
Estimating the Effect of Speeding Up One Part
The total time saved by an optimization depends on how much of the original run belongs to the improved component.
-
Verifying Correctness While Measuring an Optimization
A comparison needs to confirm that each version computes the promised result. Shortcuts omitting meaningful work can look fast.
-
Recording Inputs for a Microbenchmark
A microbenchmark measures a narrow operation under controlled inputs. Describe data shape and setup so another run tests the same work.
-
Initial and Steady Memory Use
A program can allocate setup data at launch and retain different structures while processing. Observe which stage a peak describes.
-
Identifying Work Repeated for the Same Inputs
A trace or profile may reveal one computation repeated under equivalent inputs. Confirm its result and effects before sharing it.
-
Many Small Queries in a Single View
A page can load its parent list once and then issue a separate query for information attached to each row. The number of operations grows with result size.
-
Batching to Share Fixed Overhead
A batch can combine many operations into fewer requests or writes. It can also change memory use, wait time, and recovery scope.
-
Measuring Empty and Full Results Separately
An operation can spend time finding data and time serializing its result. Empty and full outputs may stress different parts of that path.
-
Evaluating Tail Latency at Different Load Levels
A latency distribution can shift under load as queues, shared resources, and arrival patterns change.
-
A Monotonic Clock for Elapsed Timing
An elapsed-time clock can measure a duration without relying on jumps in display time caused by wall-clock adjustments.
-
When a Benchmark Measures Buffering
A function can return before underlying data transfers are complete. Measure the promised completion stage if downstream consumers need the finished result.
-
Reporting a Performance Result with Its Scope
Performance evidence is clearer when it includes workload, measured boundary, environment, sample count, and output verification.