



























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Insights into performance engineering, focusing on the importance of addressing performance needs and ensuring program performance. It discusses the concept of service level objectives (slos) and slas, performance measurement, analysis, and patterns, as well as various optimization techniques such as loop unrolling and if statement elimination. It also covers performance measurement problems and solutions, and the use of caching and lookasides.
Typology: Study notes
1 / 35
This page cannot be seen from the preview
Don't miss anything!




























Evidence: the midterm. My initial policies don't properly support the outcomes I desire. Evidence: people wishing to use the course to apply to the MS program. The course has been used for unforeseen purposes. Evidence: too much grading to do, no help available. In practice, the structure I proposed isn't sustainable. As of now, this course as an experiment is "at risk": Problem: assignments too abstract. Solution: make assignments concrete. Need: skill building Problem: group assignments do not serve. Solution: individual assignments. Need: certification of individual skills Problem: essays are difficult to grade. Solution: exercises in practice are easier Need: sustainability Therefore, for the survival of the course as a concept , it is necessary to rethink the course to address these needs: Some straight talk on the future of the course Monday, November 05, 2012 8:21 AM Docsity.com
Solution: exercises in practice are easier to complete and to grade. Docsity.com
A Service Level Objective (SLO): defines what is "fast enough". A Service Level Agreement (SLA): defines economic penalties for not meeting SLOs. Some important language from Service- Oriented Architecture (SOA) Some important language from Service Oriented Architecture Monday, November 05, 2012 9:02 AM Docsity.com
"Web service requests should respond in less than 1 second of real time. An appropriate SLO: "If less than 90% of requests meet the SLO in a month, the customer doesn't pay anything for the service." A related SLA: SLOs and SLAs Monday, November 05, 2012 8:58 AM Docsity.com
Performance isn't free. But neither is lack of performance. Often, performance engineering is a matter of balancing the cost of performance against its value. The point of SLOs and SLAs The point of SLOs and SLAs Monday, November 05, 2012 9:03 AM Docsity.com
Factoring: what factors contribute to performance Performance measurement: how we document how programs perform Performance analysis: how we determine the performance problems for software. Performance patterns: how we address common performance problems. Performance engineering Performance engineering Monday, November 05, 2012 8:44 AM Docsity.com
Performance problems are usually expressed in terms of bottlenecks. A bottleneck is a specific performance problem that -- if addressed -- most effectively speeds up total execution. You might also hear a bottleneck defined through specifying the "critical resource". The concept of a bottleneck The concept of a bottleneck Monday, November 05, 2012 9:09 AM Docsity.com
CPU-bound: the critical resource is the speed of the processing unit. Cache-bound: the critical resource is the size of the CPU cache. Memory-bound: the critical resource is the speed of the (front-side) memory bus. Disk-bound: the critical resource is the speed of (local) disk access. Network-bound: the critical resource is the speed of the connected network/internet. Service-bound: the critical resource is the speed of response of a remote service. Kinds of bottlenecks: Kinds of bottlenecks Monday, November 05, 2012 9:11 AM Docsity.com
times command: tells how long a program ran (in cpu time and real time). getrusage system call: indicates time used, memory used. profiling: gives detailed resource consumption of functions. Performance measurement: Performance measurement Monday, November 05, 2012 8:46 AM Docsity.com
Compile a special statistics library into the code. Keep statistics on CPU consumption in each subroutine. Profiling gcc - pg file.c ./a.out # store results gprof a.out # report results Profiling Monday, November 05, 2012 10:35 AM Docsity.com
for (i=0; i<10; i++) foo(i); Change: foo(0); foo(1); foo(2); foo(3); foo(4); foo(5); foo(6); foo(7); foo(8); foo(0); To: A common form of performance optimization: loop unrolling: The actual mechanics of the loop slow down execution (i<10, i++) Why? Case study: loop unrolling Monday, November 05, 2012 11:02 AM Docsity.com
In truly performance-critical code, it is often advantageous to eliminate if statements and replace them with indirections. Eliminating "if" statements if (something(x)) foo(x); Example: Becomes foo(redirect(x)) Where x if something(x); a random other place if! something(x); redirect(x) has two values: The trick is to do this without invoking the "if" statement at all, e.g., by making redirect(x) involve only arithmetic. For example, in a profiler, it is cheaper to measure everything (and then throw some statistics away) than to measure selectively, because the "if" statement slows down the code. Advanced performance optimization: eliminating if statements Monday, November 05, 2012 11:04 AM Docsity.com
If runtime is not solely dependent upon program design.
○ If external factors contribute. Often gprof fails to provide anything useful The complex cases The complex cases Monday, November 05, 2012 10:56 AM Docsity.com
Resource latency: time spent waiting for resources. Concurrency latency: time spent waiting for concurrent (unrelated) tasks to finish. Solution: Wallclock time - Execution time = Resource latency + Concurrency latency Typical approach: isolate test on quiescent system, then concurrency latency is 0. Performance measurement problems and solutions: Performance measurement problems and solutions Monday, November 05, 2012 9:29 AM Docsity.com