Author vstinner
Recipients Ma Lin, Mark.Shannon, inada.naoki, jdemeyer, josh.r, vstinner
Date 2019-08-13.15:50:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565711421.09.0.686457312418.issue37774@roundup.psfhosted.org>
In-reply-to
Content
Few more links about likely/__builtin_expect:

* GCC documentation says: "In general, you should prefer to use actual profile feedback for this (-fprofile-arcs), as programmers are notoriously bad at predicting how their programs actually perform."

  https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

* https://softwareengineering.stackexchange.com/questions/188853/how-much-usage-of-likely-and-unlikely-macros-is-too-much

  "If you're writing for x86/x64 (and are not using 20-year-old CPUs), the performance gain from using __builtin_expect() will be negligible if any."

* http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html

  "This optimized version [PGO] runs significantly faster (...) than our version that used __builtin_expect()."

  [When __builtin_expect() is misused] "In this case, unsurprisingly, we made each check run slower (...)"

* https://stackoverflow.com/questions/109710/how-do-the-likely-unlikely-macros-in-the-linux-kernel-work-and-what-is-their-ben

  "Like all such performance optimisations you should only do it after extensive profiling to ensure the code really is in a bottleneck (...)"

* https://stackoverflow.com/questions/10922607/gcc-likely-unlikely-macro-usage
History
Date User Action Args
2019-08-13 15:50:21vstinnersetrecipients: + vstinner, inada.naoki, Mark.Shannon, jdemeyer, josh.r, Ma Lin
2019-08-13 15:50:21vstinnersetmessageid: <1565711421.09.0.686457312418.issue37774@roundup.psfhosted.org>
2019-08-13 15:50:21vstinnerlinkissue37774 messages
2019-08-13 15:50:20vstinnercreate