Programming Books C Java PHP Python Learn more Browse Programming Books
Qty:1
  • List Price: $39.99
  • Save: $10.59 (26%)
FREE Shipping on orders over $35.
Only 5 left in stock (more on the way).
Ships from and sold by Amazon.com.
Gift-wrap available.
Add to Cart
FREE Shipping on orders over $35.
Used: Very Good | Details
Condition: Used: Very Good
Comment: Used book in very good condition Has very little wear and tear on the cover. Binding is tight and in excellent condition. Has pages that contain markings, notes, or highlighting from a previous owner. Buy your literature with confidence! This book qualifies for PRIME and FREE SHIPPING!
Access codes and supplements are not guaranteed with used items.
Add to Cart
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Efficient C++: Performance Programming Techniques Paperback – November 13, 1999

ISBN-13: 078-5342379501 ISBN-10: 0201379503 Edition: 1st

Buy New
Price: $29.40
18 New from $25.87 24 Used from $4.23
Amazon Price New from Used from
Paperback
"Please retry"
$29.40
$25.87 $4.23
Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student


Frequently Bought Together

Efficient C++: Performance Programming Techniques + Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition) + Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
Price for all three: $106.93

Buy the selected items together

NO_CONTENT_IN_FEATURE

Save up to 90% on Textbooks
Rent textbooks, buy textbooks, or get up to 80% back when you sell us your books. Shop Now

Product Details

  • Paperback: 336 pages
  • Publisher: Addison-Wesley Professional; 1 edition (November 13, 1999)
  • Language: English
  • ISBN-10: 0201379503
  • ISBN-13: 978-0201379501
  • Product Dimensions: 0.7 x 7.1 x 9.2 inches
  • Shipping Weight: 1.4 pounds (View shipping rates and policies)
  • Average Customer Review: 3.9 out of 5 stars  See all reviews (16 customer reviews)
  • Amazon Best Sellers Rank: #923,494 in Books (See Top 100 in Books)

Editorial Reviews

From the Inside Flap

If you conducted an informal survey of software developers on the issue of C++ performance, you would undoubtedly find that the vast majority of them view performance issues as the Achilles' heel of an otherwise fine language. We have heard it repeatedly ever since C++ burst on the corporate scene: C++ is a poor choice for implementing performance-critical applications. In the mind of developers, this particular application domain was ruled by plain C and, occasionally, even assembly language.

As part of that software community we had the opportunity to watch that myth develop and gather steam. Years ago, we participated in the wave that embraced C++ with enthusiasm. All around us, many development projects plunged in headfirst. Some time later, software solutions implemented in C++ began rolling out. Their performance was typically less than optimal, to put it gently. Enthusiasm over C++ in performance-critical domains has cooled. We were in the business of supplying networking software whose execution speed was not up for negotiation--speed was top priority. Since networking software is pretty low on the software food-chain, its performance is crucial. Large numbers of applications were going to sit on top of it and depend on it. Poor performance in the low levels ripples all the way up to higher level applications.

Our experience was not unique. All around, early adopters of C++ had difficulties with the resulting performance of their C++ code. Instead of attributing the difficulties to the steep learning curve of the new object-oriented software development paradigm, we blamed it on C++, the dominant language for the expression of the paradigm. Even though C++ compilers were still essentially in their infancy, the language was branded as inherently slow. This belief spread quickly and is now widely accepted as fact. Software organizations that passed on C++ frequently pointed to performance as their key concern. That concern was rooted in the perception that C++ cannot match the performance delivered by its C counterpart. Consequently, C++ has had little success penetrating software domains that view performance as top priority: operating system kernels, device drivers, networking systems (routers, gateways, protocol stacks), and more.

We have spent years dissecting large systems of C and C++ code trying to squeeze every ounce of performance out of them. It is through our experience of slugging it out in the trenches that we have come to appreciate the potential of C++ to produce highly efficient programs. We've seen it done in practice. This book is our attempt to share that experience and document the many lessons we have learned in our own pursuit of C++ efficiency. Writing efficient C++ is not trivial, nor is it rocket science. It takes the understanding of some performance principles, as well as information on C++ performance traps and pitfalls.

The 80-20 rule is an important principle in the world of software construction. We adopt it in the writing of this book as well: 20% of all performance bugs will show up 80% of the time. We therefore chose to concentrate our efforts where it counts the most. We are interested in those performance issues that arise frequently in industrial code and have significant impact. This book is not an exhaustive discussion of the set of all possible performance bugs and their solutions; hence, we will not cover what we consider esoteric and rare performance pitfalls.

Our point of view is undoubtedly biased by our practical experience as programmers of server-side, performance-critical communications software. This bias impacts the book in several ways:

The profile of performance issues that we encounter in practice may be slightly different in nature than those found in scientific computing, database applications, and other domains. That's not a problem. Generic performance principles transcend distinct domains, and apply equally well in domains other than networking software. At times, we invented contrived examples to drive a point home, although we tried to minimize this. We have made enough coding mistakes in the past to have a sizable collection of samples taken from real production-level code that we have worked on. Our expertise was earned the hard way--by learning from our own mistakes as well as those of our colleagues. As much as possible, we illustrated our points with real code samples. We do not delve into the asymptotic complexity of algorithms, data structures, and the latest and greatest techniques for accessing, sorting, searching, and compressing data. These are important topics, but they have been extensively covered elsewhere Knu73, BR95, KP74. Instead, we focus on simple, practical, everyday coding and design principles that yield large performance improvements. We point out common design and coding practices that lead to poor performance, whether it be through the unwitting use of language features that carry high hidden costs or through violating any number of subtle (and not so subtle) performance principles.

So how do we separate myth from reality? Is C++ performance truly inferior to that of C? It is our contention that the common perception of inferior C++ performance is invalid. We concede that in general, when comparing a C program to a C++ version of what appears to be the same thing, the C program is generally faster. However, we also claim that the apparent similarity of the two programs typically is based on their data handling functionality, not their correctness, robustness, or ease of maintenance. Our contention is that when C programs are brought up to the level of C++ programs in these regards, the speed differences disappear, or the C++ versions are faster.

Thus C++ is inherently neither slower nor faster. It could be either, depending on how it is used and what is required from it. It's the way it is used that matters: If used properly, C++ can yield software systems exhibiting not just acceptable performance, but yield superior software performance.

We would like to thank the many people who contributed to this work. The toughest part was getting started and it was our editor, Marina Lang, who was instrumental in getting this project off the ground. Julia Sime made a significant contribution to the early draft and Yomtov Meged contributed many valuable suggestions as well. He also was the one who pointed out to us the subtle difference between our opinions and the absolute truth. Although those two notions may coincide at times, they are still distinct.

Many thanks to the reviewers hired by Addison-Wesley; their feedback was extremely valuable.

Thanks also to our friends and colleagues who reviewed portions of the manuscript. They are, in no particular order, Cyndy Ross, Art Francis, Scott Snyder, Tricia York, Michael Fraenkel, Carol Jones, Heather Kreger, Kathryn Britton, Ruth Willenborg, David Wisler, Bala Rajaraman, Don "Spike" Washburn, and Nils Brubaker.

Last but not least, we would like to thank our wives, Cynthia Powers Bulka and Ruth Washington Mayhew.

0201379503P04062001

From the Back Cover

Far too many programmers and software designers consider efficient C++ to be an oxymoron. They regard C++ as inherently slow and inappropriate for performance-critical applications. Consequently, C++ has had little success penetrating domains such as networking, operating system kernels, device drivers, and others.

Efficient C++ explodes that myth. Written by two authors with first-hand experience wringing the last ounce of performance from commercial C++ applications, this book demonstrates the potential of C++ to produce highly efficient programs. The book reveals practical, everyday object-oriented design principles and C++ coding techniques that can yield large performance improvements. It points out common pitfalls in both design and code that generate hidden operating costs.

This book focuses on combining C++'s power and flexibility with high performance and scalability, resulting in the best of both worlds. Specific topics include temporary objects, memory management, templates, inheritance, virtual functions, inlining, reference-counting, STL, and much more.

With this book, you will have a valuable compendium of the best performance techniques at your fingertips.



0201379503B04062001

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

3.9 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

31 of 32 people found the following review helpful By Daniel Mall on January 4, 2001
Format: Paperback
The authors are developers of network and web server software for IBM. They specifically target performance issues related to C++ programming. The primary topics of discussion are constructors & destructors, virtual functions, return value optimization, temporary objects, inlining, memory managers, and reference counting. Learn how to create efficient constructor functions. Learn how to avoid the costly construction of temporary objects. The authors promote "lazy evaluation" and nail "useless computations" and "obsolete code." Algorithm and data structure discussions are referred to other standard references, however there is coverage of the STL structures (insertion, deletion, traversal, and find operations). An additional bonus is the excellent coverage of multithreading issues.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
25 of 26 people found the following review helpful By George V. Reilly on June 16, 2000
Format: Paperback
I thought the book a useful compendium of performance information, as far as it went: temporaries, constructors and destructors, virtual functions, inlining, reference counting, some STL, multiprocessor scalability, and system architecture dependencies. My reservations are the number of omissions (most of the Standard Library, space efficiency, exceptions, performance measurement, etc.) and the number of typos.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
18 of 19 people found the following review helpful By Robert A. Gibson on February 25, 2000
Format: Paperback
To start, I have to say that this book is well written. By using examples from personal experience, they also keep you very involved. So far, I have been forced to put the book down, in order to test the examples they describe.

I was astonished with their first example, where a poorly thought out Trace class caused performance to drop 80%.

Talk about bang for the buck! By reading this book, I expect to give a great deal more thought to the performance implications from the start.

Good job guys!
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
14 of 15 people found the following review helpful By A Customer on November 30, 1999
Format: Paperback
Useful and Important. Three good chapters on use of the keyword inline. It covers specifics on when the current crop of compilers can and cannot satisfy requests to inline function calls. Some potential workarounds are covered in detail. Includes some hints on when a compiler might actually be able to inline a virtual function call - something I've hoped for, but have been disappointed by in the past.
Read it, weep, and then write a letter to your compiler vendor asking them to improve the state of the art in compilers. (I'm most familiar with VC6. Your mileage may vary.)
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
8 of 8 people found the following review helpful By David Elder on July 7, 2004
Format: Paperback
Bulka and Mayhew's "Efficient C++" is an enjoyable and useful book, filled with helpful information that can be immediately applied to C++ programming. Its coverage of techniques for inlining, achieving the return value optimization, and avoiding temporary object creation is quite good. I also found the second chapter, which presents a case study about writing a tracer class, to be informative and a tidy overview of efficiency methods. There are also chapters discussing virtual functions, memory pooling, STL, and efficiency at the implementation and design levels. One helpful feature of this book is its presentation of a number of bar graphs illustrating the runtimes of actual test code. This helps to hammer home just how efficient or costly various techniques actually are.
Unfortunately, there are a number of topics which are not discussed or are only briefly discussed. The chapter on the STL, while accurate, is very incomplete. I would recommend bolstering this information with Meyers' "Effective STL". Also, different compilers implement different optimizations. It would have been nice to see a discussion of the optimizations provided by the most popular compilers, as well as tips on how to use these features effectively. The C++ standard allows compiler implementers to ignore certain keywords (register and inline) and to provide optimizations such as the return value optimization. I would have liked to have seen a discussion of the optimizations actually provided by various compilers as well as how they relate to the C++ standard. In addition, there are some advanced techniques, such as the Barton-Nackman trick, for avoiding the cost of virtual functions. Unfortunately, this and other comparable methods are not discussed.
On the whole, this book provides a lot of valuable information, but it could have been much more complete.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
6 of 6 people found the following review helpful By wintermute on February 9, 2010
Format: Paperback
Most of the book is similar to Meyers books. The last chapter is great. I don't know of any other book that presents this information, and this is what programmers screw up most when trying to write high performance code. This chapter discusses how to write extremely tight code considering the actual hardware you're running on (a lot of this is generalizable, since a lot of hardware is similar enough.). Things like writing code to avoid cache misses. Code that pipelines well. Replacing conditionals with small non-conditional code (avoid the branch). Context switching performance, etc.. Basically, this section is what gets you to actually think about the system you're writing software for. The real world, practical reality.

This topic is a must have, especially if you're writing a game engine or physics engine. Anything that needs to be as fast as possible, or faster than the competition... handling loads of data in real time.

I gave the book 3 stars, because I really want a full book on this, not just a short chapter at the end as an afterthought. The authors however do cite 2 other books that they used to write this section, and I'm going to go check them out. As an introduction to hardware-minded performance optimization, this chapter is pretty cool.
1 Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Customer Images

Most Recent Customer Reviews

Search

What Other Items Do Customers Buy After Viewing This Item?