Errata

Optimized C++

Errata for Optimized C++

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
1
1st paragraph

There are no page numbers for my copy of this book. The error is in the 1st paragraph of "Chapter 1. An Overview of Optimization". It's a typo for "that":

"programs tht need to run flat-out"

should obviously be:

"programs that need to run flat-out"

Paul evans  Mar 16, 2015 
7
Use a Better Compiler, Use Your Compiler Better

There are no page numbers for my copy of this book. The problem is with the "Chapter 1. Summary of Strategies for Optimizng C++ Code: Use a Better Compiler, Use Your Compiler Better" section.

There's no mention of the clang compiler. This is a major oversight for a professional book on optimized C++.

Paul Evans  Mar 17, 2015 
7
Use a Better Compiler, Use Your Compiler Better

There are no page numbers for my copy of this book. The problem is with the "Chapter 1. Summary of Strategies for Optimizng C++ Code: Use a Better Compiler, Use Your Compiler Better" section.

"Compile times are slightly shorter without the optimizer. This was a big deal in the 1990s, but nowadays compilers and computers are so fast that it offers little benefit."

This simply isn't true. Many corporations regularly deploy huge C++ systems and compile time is still a critical issue. I consult on such products for the financial sector, and my colleages and I have a big issues with compile times running into hours. I've also heard from peers working in agile environments where a 15 minute build time is a huge problem.

Paul Evans  Mar 17, 2015 
13
bootom

There are no page numbers for my copy of this book. The error is in the 1st paragraph of "Chapter 1. An Overview of Optimization. Summary"

At the bottom of the summary you state:

"As I said, the devil is in the details."

this is the first and only time this is mentioned in the book.

Paul Evans  Mar 18, 2015 
17
1st paragraph

There are no page numbers for my copy of this book. The error is in the 1st paragraph of the Memory is Not Accessed in Bytes section of Chapter 2.

The sentence:

"Desktop-class processors may fetch 64 bytes at once."

should be:

"Desktop-class processors may fetch 64 bits at once."

Paul Evans  Mar 18, 2015 
PDF Page 18
Second paragraph

The text includes a symlink to "#chapter-measuring-performance" in two places rather than spelling out the name of the chapter.

Anonymous  Sep 30, 2015 
PDF Page 19
First paragraph

The text contains a symlink to "#chapter-measuring-performance" rather than spelling out the title.

Anonymous  Sep 30, 2015 
PDF Page 20
Fifth, sixth and seventh paragraphs

The text contains symlinks to "#chapter-strings" or "???". These should be spelled out.

This is the third consecutive page of the released book containing this type of error suggesting quality control was not present in the publication and should not have had the "Pre Release" moniker removed.

Anonymous  Sep 30, 2015 
PDF Page 20
2nd paragraph of "Memory Words Have a Big End and a Little End"

Little-Endianness and Big-Endianness are mixed-up in the example:

"If the int value 0x01234567
is stored at addresses 1000–1003, and the little end is stored first, address 1000 holds
the byte 0x01 and address 1003 holds the byte 0x67, whereas if the big end is stored
first, address 1000 holds 0x67 and the 0x01 is at address 1003"

The most significant byte is 0x01, so a big-endian machine will store it at address 1000 not in 1003, according to the example in the text.

The rest of the paragraph is OK, but the example contradicts the valid information.

Anonymous  Sep 06, 2016 
25
last paragraph

There are no page numbers for my copy of this book. The error is in the last paragraph of the C++ Tells Lies Too section of Chapter 2.

Typo:

"In C++, assigning ont int to another"

should be:

"In C++, assigning an int to another"

Paul Evans  Mar 19, 2015 
Printed Page 27
3rd paragraph

On this episode, "Isaac Newton measured the gravitational constant by timing falling objects against his heartbeat." I think author is misunderstanding by "Galileo Galilei measured the isochrony of the pendulum by his heartbeat." Henry Cavendish succeeded measure of gravitational constant in 1798, 70 years after Newton's death. :-)

Yukitoshi Fujimura  Jan 16, 2017 
28
1st paragraph

There are no page numbers for my copy of this book. The error is in the 1st paragraph of "Chapter 3. Measure Performance"

Typo:

"I discus how to design"

should be:

"I discuss how to design"

Paul Evans  Mar 19, 2015 
PDF Page 33
3rd paragraph

"After a conditional branch instruction, eexecution continues" - note eexecution (sic).

Jason  Sep 23, 2015 
PDF Page 35
1st

"In such a situation, improving
response time from 0.1 second to one millisecond adds virtually no value, even
though it is 1000 times faster."

.1 seconds = 100ms 1ms/100ms is 100x faster not 1000.

Nathan Beasley  Mar 16, 2016 
PDF Page 76
Eliminate Pointer Dereference Using Iterators

"Eliminate Pointer Dereference Using Iterators" describes the efficiency gained by using iterators as "avoiding pointer dereference". In reality most iterators are actually implemented as pointers. The efficiency gained by iterators is not in avoiding the dereference but rather in not having to do pointer arithmetic under the hood. So in example 4-4 calling s[i] is in effect s + i. However when iterators are used this pointer arithmetic is integrated with the increment of the for loop, thereby saving that addition. However technically both example 4-4 and 4-5 still dereference pointers.

Steve  Sep 11, 2016 
PDF Page 96
last paragraph

The line
"At the point of use, conversion is often no needed."

was probably supposed to be "not needed".

Jeffrey Reynolds  Dec 30, 2015 
PDF Page 132
Section on Double Dispatch

All that is displayed on the PDF is "[Double-dispatch is an optimizing strategy versus if/else and dynamic-cast. Need
code example]".

The e-pub version appears to have the same problem.

David Racey  Nov 20, 2015 
Printed Page 139
first code snippet at top of page

code says:
std::vector<int> a(1000000, 0);
...
std::vector<int> b; // b is empty
std::wrap(v,w); // now b has a million entries <-- v,w should be a,b

code snippet essentially uses the wrong variables.

Ilja van Sprundel  Sep 01, 2016 
Printed Page 149
4th paragraph

A test of the optimized code runs in 636 milliseconds ...

The unit for this and 541 in the same paragraph should be microseconds (compared to the second paragraph where non-optimized tim is 13.238 milliseconds and 11.467 milliseconds.

Anonymous  Sep 16, 2018