7.4 Benchmark Testing
Benchmarking is the process of comparing the performance of multiple programs that perform the same task. Benchmark testing can involve comparing different implementations of the same program or different versions of the same implementation. The primary goal is to determine if a change has improved or worsened the program’s speed.
When benchmarking, various factors can be considered, such as processing time, memory usage, and disk access time. In this section, we’ll primarily focus on processing time.
To illustrate benchmarking in Rust, let’s consider a scenario where we want to compare two different implementations of sorting elements in an array. These implementations are included as the functions shown in Listing 7.23 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access