Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Zen of code optimization
Abrash M., Coriolis Group Books, Scottsdale, AZ, 1994. Type: Book (9781883577032)
Date Reviewed: May 1 1995

The best thing about this book is the author’s writing style. When I read any chapter of his book, it appears that he is talking and I am listening, and he grabs all my attention with interesting stories. Books on such dry subjects have made me drowsy at times; not this one!

The author states the book’s basic purpose well in the preface: “This book is for intermediate to advanced programmers in C, C++ and assembly language who want to learn the techniques of code optimization: that is techniques to produce the fastest possible code on their machines.” The book is most useful when one wants to do some hands-on exercises. Such a reader needs access to an Intel-based PC, preferably a 386, 486, or Pentium, along with debugger tools like Code View or Turbo Debugger for code generated by C and C++ compilers. The author has provided a code disk with the book, which makes the book an attractive buy. The code disk includes the author’s Zen Timer utility, and several programs to demonstrate code optimization discussed in the book. Abrash claims that these programs have been tested with the latest Borland and Microsoft compilers and assemblers, and that most of these programs are compatible with previous versions of the Borland and Microsoft compilers and assemblers. My limited experimentation with the programs tended to support that claim, although I do not claim to have done extensive testing, which would be a large task outside the scope of the work of a volunteer.

Chapter 2 discusses the nature of assembly language optimization. The author recommends supplementing this book with some good books to gain familiarity with the operating system application program interfaces and basic input/output system (BIOS) interfaces. In chapter 3, the author begins to introduce his Zen Timer tool for measuring the performance of a given piece of code, and in that sense having a metric for performance. The reader should keep in mind, however, that the Zen Timer cannot provide the knowledge of how to write high-performance code; it is simply a tool that assists in the acquisition of that knowledge from the book. Chapter 4 discusses the impact of PC hardware (8-bit Bus Cycle-Eater, The Prefetch Queue Cycle-Eater, DRAM Refresh Cycle-Eater, and Display Adapter Cycle-Eater) on code performance and offers hints about capitalizing on this knowledge. Chapter 5 looks into some file search techniques, including brute-force techniques and the value of restartable blocks.

Chapter 6 discusses some machine instructions of the Intel-based machines and how to take advantage of them for code optimization. Chapter 7 essentially develops a strategy for the tradeoff between algorithms and cycle counting for local optimization.

Chapter 8 is interesting and useful. It talks about speeding up C with assembly language. Chapter 9 includes the optimization hints the author received from his readers. In chapter 10, the author talks about the value of patience in coding for achieving faster code.

Chapter 11 discusses pushing the performance of 80286 and 80386 machines, while chapters 12 and 13 discuss pushing and aiming 80486 machines. Chapter 14 provides an optimization of the Boyer-Moore string algorithm. Chapter15 discusses problems with familiar data structures like linked lists and circular lists. Chapters 19, 20, and 21 are devoted to the Pentium chip. Chapters 16, 17, 18, and 22 take the optimization techniques learned in the book to new heights. Appendix A provides a full listing of the C-callable Zen Timer on the disk that comes with the book.

Among the best features of the book are its readability and its suitability for experienced programmers in C, C++, and assembly language. The book has a reasonable index.

Reviewer:  Jagdish C. Agrawal Review #: CR118194
Bookmark and Share
 
Coding Tools and Techniques (D.2.3 )
 
 
C (D.3.2 ... )
 
 
Intel Assembly Language (D.3.2 ... )
 
 
Methodologies (D.2.10 ... )
 
 
Metrics (D.2.8 )
 
Would you recommend this review?
yes
no
Other reviews under "Coding Tools and Techniques": Date
Typographic style is more than cosmetic
Oman P., Cook C. Communications of the ACM 33(5): 506-520, 1990. Type: Article
Mar 1 1991
Obfuscated C and other mysteries
Libes D., John Wiley & Sons, Inc., New York, NY, 1993. Type: Book (9780471578055)
Aug 1 1993
Writing solid code
Maguire S., Microsoft Press, Redmond, WA, 1993. Type: Book (9781556155512)
Feb 1 1994
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy