Hacker News new | past | comments | ask | show | jobs | submit login




Interesting. From the comment in abseil's implementation:

// Compilers can use the information that a certain branch is not likely to be

// taken (for instance, a CHECK failure) to optimize for the common case in

// the absence of better information (ie. compiling gcc with `-fprofile-arcs`).

//

// Recommendation: Modern CPUs dynamically predict branch execution paths,

// typically with accuracy greater than 97%. As a result, annotating every

// branch in a codebase is likely counterproductive; however, annotating

// specific branches that are both hot and consistently mispredicted is likely

// to yield performance improvements.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: