Performance Flashcards
What are several attributes of performance?
Speed
Throughput
Responsiveness
Memory Consumption
To measure performance, we need to design ______ specifically targeting performance objectives
tests
When measuring performance, it really comes down to _______
benchmarking
What are microbenchmarks?
Focusing on small things, like the cost of an operation in isolation. It can help identify core performance details and explain causes
What are macrobenchmarks?
Real world system performance
What are some possible issues in the below code? startTime = getCurrentTimeInSeconds(); doWorkloadOfInterest(); endTime = getCurrentTimeInSeconds(); reportResult(endTime – startTime);
Measurement granularity Warm up effects Nondeterminism Size of workload System interference Background programs?
When bench marking, why do workloads need to be chosen carefully?
Workloads need to be representative. Some inputs can be pathological to stress test.
Measuring something ____ means nothing
once
Using ______ instead of time can be better to predict performance on different machines
cycles
Why is warm up time necessary?
Code might not be compiled until it’s executed frequently (JIT for Java)
Need to make sure code is paged in`
How can we alleviate warm up time issues in tests?
Run the workload many times before benchmarking it (Bad strategy for JVMs)
When benchmarking, you should benchmark many times and average the times to combat ______________ behavior. However, this might throw info away and we might want to know each value
Nondeterministic
How do we interpret/report a benchmark?
Compare that benchmark with your expectation, different solutions, or the performance over time
What is a benchmark suite?
A dataset with multiple benchmarks
What are two methods we can use to consider interpreting a benchmark suite?
Hypothesis testing (ANOVA) Summary statistic (condensing a suite to a single number)
What are the 2 different types of means? What are they each used for? Give their formulas
Arithmetic Mean - Good for reporting averages of numbers that mean the same thing: (Summation of X)/N
Harmonic Mean - Good for reporting rates: N/(Summation of (1/x))
Geometric Mean - Good for reporting results that mean different things (timing results across many different tests in the same suite: Nth root(PI(X))
If a size of a workload changes, a _______ harmonic mean is required
weighted
Why would we want to use a geometric mean?
Review lecture video for slide 75
What low level architectural effects can determine the performance? How well does sampling based profiling work for these? What other tools can measure these effects?
Cache misses Mis-speculations TLB misses Not well, due to prediction issues Tools like perf
In what ways can we optimize algorithms in the real world?
Hybrid Algorithms - where constants matter
Caching and precomputing
Better performance modeling and algorithms
Asymptotic complexity is less useful in practice - We want to focus on memory, I/O, consistency and speculation, and shapes of workloads
Cache oblivious algorithms and data structures