Performance Flashcards
What is benchmarking?
Comparing the performance of two or more programs that do the same thing. (Either different versions of a program or two entirely different programs).
What is microbenchmarking?
Measuring the performance of something small (e.g. a single function, loop, etc).
Why is microbenchmarking volatile?
Because there are so many outside factors that can skew such benchmarks. Compiler optimizations, CPU operations, etc can throw off the benchmark.
Whole program profiling is considered preferable.
What is stress testing?
Subjecting software to workloads outside the scope of normal operation to test robustness.
What is the difference between wall time and CPU time?
Wall Time: The total amount of real time elapsed.
CPU Time: The amount of time the CPU spent on the task in question.
What is Profile-Guided Optimization (PGO)?
An optimization technique that uses runtime profiling data to guide a second optimization of a program.
What do the words “hot” and “cold” mean in profiling?
They are use adjectivally to describe areas of the code that are executed many times (hot) or not very often (cold).
What is the program perf?
A general purpose profiler that runs on Linux.
Name 2 frontends for perf.
Hotspot and Firefox Profiler
What is the program AMD uprof?
A general purpose profiler that runs on Windows and Linux.
What are the 2 best candidates for function inlining?
- Very small functions.
2. Functions with a single call site.
How could you handle inlining when you have a large function w/ 1 hot call site and multiple cold call sites.
Inline the function, then make a wrapper around the function to use at the cold call sites so as to reduce code bloat.