ACCU Home page ACCU Conference Page
Search Contact us ACCU at Flickr ACCU at GitHib ACCU at Facebook ACCU at Linked-in ACCU at Twitter Skip Navigation

Search in Book Reviews

The ACCU passes on review copies of computer books to its members for them to review. The result is a large, high quality collection of book reviews by programmers, for programmers. Currently there are 1949 reviews in the database and more every month.
Search is a simple string search in either book title or book author. The full text search is a search of the text of the review.
    View all alphabetically
Title:
Optimized C++
Author:
Kurt Guntheroth
ISBN:
978-1-491-92206-4
Publisher:
O’Reilly
Pages:
400
Price:
£29.12
Reviewer:
Paul Floyd
Subject:
Appeared in:
31-3

I’ve always been an advocate of avoiding gratuitous premature pessimization (is it ever possible to mention optimization without quoting or paraphrasing Knuth/Hoare?). So this book was pretty much up my street. It’s well written, and I liked the fact that it uses C++11 – there’s no point in pandering to the laggards that are stuck in the last century. There are 13 chapters that cover an introduction, hardware and timing, algorithmic optimization, low level optimizations (code changes, memory use, I/O and threads) and memory management.

I enjoyed the coverage of timing, and in particular the limitations and evolution of the timing features available on x86 based systems. Another high point was the debunking of some myths like std::vector always being significantly faster than std::list, along with fairly wide ranging tests. However, this leads me to one of the weaknesses. Pretty much all of the testing was done with one compiler (MS Visual Studio) and platform. So without a wider range of platforms and compilers I found myself taking the results with a pinch of salt.

There were three things that struck me as missing. In Chapter 4, there is a lengthy discourse on optimizing a function that strips control characters from a string. One of the techniques used is pass by reference. This results in an 8% performance degradation, which is not explained in any way. I would expect a book like this to get to the bottom of such as issue. The second thing that is missing is detailed coverage of profiling tools. The author seems to prefer instrumenting code with timer calls, which is good enough, but I thought that there should have been some explanation of the different kinds of profilers and some example usage. Lastly, a lot is said about std::string and its performance not being great. However, there is no mention of the Short String Optimization (SSO). I was expecting some mention of it and perhaps characterizing the performance ‘knee’ is string lengths exceed the SSO threshold.

In summary I enjoyed reading this book and learned a few things but there were a few annoying nits.

Recommended.