The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning...
-
Upload
bryce-carter -
Category
Documents
-
view
220 -
download
0
description
Transcript of The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning...
![Page 1: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/1.jpg)
The Process
From bare bones to finished product
![Page 2: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/2.jpg)
The Steps
Programming Debugging Performance Tuning Optimization
![Page 3: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/3.jpg)
Programming
To create a set of instructions for a piece of hardware to follow
Two broad categories: Low-level languages High-level languages
![Page 4: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/4.jpg)
Low Level Languages
Have a limited amount of abstraction between the hardware and the programmer
Deal with registers, memory addresses, etc Are often limited to a small set of platforms due
to this Examples:
Machine Code Assembly C
![Page 5: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/5.jpg)
High Level Languages
Are “abstract” Human readable Use objects, variables, arrays, etc
Suffer from “abstraction penalty” Execution types:
Interpreted (Java, Python, Ruby) Compiled (C, C++, practically everything else) Translated (Often translated to C)
![Page 6: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/6.jpg)
Debugging
The act of taking something broken and trying desperately to make it work
Where the significant time in any project is spent
Necessary for both hardware and software sides
![Page 7: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/7.jpg)
Hardware Debugging
FIGURE 17.1 Platform Debug Process
![Page 8: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/8.jpg)
Software Debugging
Can the problem be lived with? Attempt to reproduce the problem Narrow the suspects down
Divide-and-conquer Use specific debugging tools in the right place
Can lead to “false positives” Not capable of catching everything
![Page 9: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/9.jpg)
Debugging Techniques
Path tracing – printf (or equivalent) Breakpoints Stepping through Memory/core dumps
![Page 10: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/10.jpg)
Performance Tuning
Assess the problem Measure the performance Identify bottlenecks Modify that part Measure the new performance
Do not get caught up in minutiae!!
![Page 11: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/11.jpg)
Tuning
May take one of several forms Code optimization Caching Load balancing Parallelization
All are bottlenecks
![Page 12: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/12.jpg)
Optimization
More important for embedded systems Focus on the limitations of the platform
Speed Power consumption Memory usage
Exist as tradeoffs Greater speed, higher memory usage Lower power consumption, slower processing
![Page 13: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/13.jpg)
Problems
Tuning and optimization are in themselves bottlenecks – though in production, not performance
May introduce new bugs Often not “human readable” May affect ease of upgrading
![Page 14: The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.](https://reader035.fdocuments.in/reader035/viewer/2022062412/5a4d1b0d7f8b9ab05998c454/html5/thumbnails/14.jpg)
Programming, Tuning and Optimization
Code first, then tune and optimize Unoptimized code is often easier to code and
debug than optimized code Get the major flaws out of the reasoning first
Be specific Power consumption needs to be limited
Be reasonable Idealized reality rarely exists