Optimized C++
Proven Techniques for Heightened Performance
Publisher: O'Reilly Media
Final Release Date: April 2016
Pages: 388

In today’s fast and competitive world, a program’s performance is just as important to customers as the features it provides. This practical guide teaches developers performance-tuning principles that enable optimization in C++. You’ll learn how to make code that already embodies best practices of C++ design run faster and consume fewer resources on any computer—whether it’s a watch, phone, workstation, supercomputer, or globe-spanning network of servers.

Author Kurt Guntheroth provides several running examples that demonstrate how to apply these principles incrementally to improve existing code so it meets customer requirements for responsiveness and throughput. The advice in this book will prove itself the first time you hear a colleague exclaim, “Wow, that was fast. Who fixed something?”

  • Locate performance hot spots using the profiler and software timers
  • Learn to perform repeatable experiments to measure performance of code changes
  • Optimize use of dynamically allocated variables
  • Improve performance of hot loops and functions
  • Speed up string handling functions
  • Recognize efficient algorithms and optimization patterns
  • Learn the strengths—and weaknesses—of C++ container classes
  • View searching and sorting through an optimizer’s eye
  • Make efficient use of C++ streaming I/O functions
  • Use C++ thread-based concurrency features effectively
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyOptimized C++
 
3.3

(based on 4 reviews)

Ratings Distribution

  • 5 Stars

     

    (1)

  • 4 Stars

     

    (0)

  • 3 Stars

     

    (2)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (0)

50%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (3)

Cons

No Cons

Best Uses

No Best Uses
    • Reviewer Profile:
    • Developer (3)

Reviewed by 4 customers

Displaying reviews 1-4

Back to top

(1 of 1 customers found this review helpful)

 
3.0

it's fine

By nadiasvertex

from Tuxedo Park, NY

About Me Developer

Verified Buyer

Pros

  • Accurate
  • Concise
  • Easy to understand

Cons

    Best Uses

    • Intermediate

    Comments about oreilly Optimized C++:

    I spend a lot of time writing C++. This book has some good advice in it. I am somewhat disappointed that it is very Windows and Microsoft toolchain focused. I didn't realize that until I had gotten quite a ways in. I was hoping for something more general.

    I'm also somewhat annoyed that there is little mention of good open source performance tools like Google's gbench.

    The author spends a great deal of time talking about how to measure time in Windows, which is valuable to some degree. Windows is notoriously bad at providing reliable time... which the author explains in great detail.

    I haven't finished the book yet, and since I got it on sale I'm not too upset. If I had bought this at full price I would have been really irritated.

    (1 of 1 customers found this review helpful)

     
    5.0

    A very useful book

    By The Fox

    from Zurich, Switzerland

    About Me Developer, Educator

    Verified Reviewer

    Pros

    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Intermediate
      • Student

      Comments about oreilly Optimized C++:

      This is a very good book and I am very grateful to the author that he decided to share his insights and experience with optimization in C++.

      Although I had a good notion of optimization before, I still found that the book contains many helpful examples and addresses topics that we would not even think need to be optimized. What I found nice is that the author admits to the mistakes he made, something that many of us are not willing to do. There is plenty of material on the Internet that makes unfounded claims. Thanks to this book you will realize that the situation is really not that simple and that the best way to find out is to benchmark/profile by yourself with your own compiler. I also find the final chapter on custom allocators quite useful.

      Probably I would have liked that the author performed a bit more benchmarking or provided a summary table. But other than that, good job!

      (8 of 13 customers found this review helpful)

       
      2.0

      Nothing new

      By Tom

      from Nacka, Sweden

      About Me Developer

      Verified Reviewer

      Pros

      • Easy to understand
      • Well-written

      Cons

      • Missing Information
      • Too basic

      Best Uses

      • Novice

      Comments about oreilly Optimized C++:

      If you have never before been interested in optimization and efficient code, and you are using an old compiler on Microsoft Windows, you will find a lot of new useful information in this book.

      If you (like me) have been coding C++ for some years with an interest for efficient code and using a modern compiler on Linux, you will find nothing new in this book.

      This book seems to be based on a lot of old outdated knowledge. There is a chapter about string optimization that does not even mention short string optimization. Instead the chapter spends a lot of text on copy-on-write (that was the optimization of the 1990s).

      The book mentions return value optimization, R-values, move semantics and cost of cache line misses. However, the knowledge of these important aspects are not used in the optimization examples.

      I was surprised how bad the compiler in the book was at optimizing code, compared to my experience with gcc 9.3 and clang 3.8 with the -O3 flag on Linux/Mac. A clue to why might be found in two facts: When a compiler is mentioned with test data it is Visual Studio 2010. The author mentions that he has the habit of doing test runs with debug-compiled code in the debugger in the IDE.

      (1 of 37 customers found this review helpful)

       
      3.0

      Too early for decent review

      By Daniel

      from Austria

      Verified Buyer

      Comments about oreilly Optimized C++:

      So far the book has just 3 introductory chapters that seem largely correct, but are certainly not what I was looking for. The interesting part should be in the following chapters and I'm hoping those will become available soon...

      Displaying reviews 1-4

      Back to top

       
      Buy 2 Get 1 Free Free Shipping Guarantee
      Buying Options
      Immediate Access - Go Digital what's this?
      Ebook:  $50.99
      Formats:  DAISY, ePub, Mobi, PDF
      Print & Ebook:  $65.99
      Print:  $59.99