Book contents
- Frontmatter
- Contents
- Preface
- Part I Numerical Software
- Part II Developing Software
- Part III Efficiency in Time, Efficiency in Memory
- 11 Be algorithm aware
- 12 Computer architecture and efficiency
- 13 Global vs. local optimization
- 14 Grabbing memory when you need it
- 15 Memory bugs and leaks
- Part IV Tools
- Part V Design Examples
- Appendix A Review of vectors and matrices
- Appendix B Trademarks
- References
- Index
13 - Global vs. local optimization
Published online by Cambridge University Press: 28 January 2010
- Frontmatter
- Contents
- Preface
- Part I Numerical Software
- Part II Developing Software
- Part III Efficiency in Time, Efficiency in Memory
- 11 Be algorithm aware
- 12 Computer architecture and efficiency
- 13 Global vs. local optimization
- 14 Grabbing memory when you need it
- 15 Memory bugs and leaks
- Part IV Tools
- Part V Design Examples
- Appendix A Review of vectors and matrices
- Appendix B Trademarks
- References
- Index
Summary
Picking algorithms vs. keyhole optimization
Optimizing the performance of software requires working with at least two different points of view. One is the global view where the questions are about how to structure the overall architecture of the system. Another view is how the individual routines are written, and even how each line of code is written. All of these views are important. Selecting good algorithms is as important as selecting good hardware and implementing algorithms efficiently.
When the term “optimization” is used in computing, it is often taken to mean something like picking compiler options or “writing tight code” that uses the least number of clock cycles or operations. This is clearly important in writing fast, effective software, but it is only a part of the process, which begins early in the design stage.
Usually the first part of the design stage is the design of the central data structures and databases that will be used. These should be chosen so that there are well-known efficient algorithms for handling these data structures, preferably with readily available implementations that perform correctly, reliably and efficiently. Then the algorithms to carry out the main tasks need to be selected. An important guide to selecting them is their asymptotic complexity or estimate of the time needed. However, this is not the only guide; see the last section of this chapter for more information about how to refine this information and to make sure that the asymptotic estimates are relevant in practice. The last part is the detailed design process where the algorithms are implemented, and this should be done with an eye on efficiency to ensure that the whole system works well.
- Type
- Chapter
- Information
- Writing Scientific SoftwareA Guide to Good Style, pp. 187 - 194Publisher: Cambridge University PressPrint publication year: 2006