C++ cache locality and branch predictability

C++ cache locality and branch predictability

103.287 Lượt nghe
C++ cache locality and branch predictability
Cache me outside, how bout that? People always talk about Big O time for analyzing speed, but Big O isn't the only important factor in writing performant code. Two important things to keep in mind are cache locality (locality of reference) and branch predictability. In this video, we go over these ideas and through examples we see the huge impact that they can have on performance. ― mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode Branch prediction: https://en.wikipedia.org/wiki/Branch_predictor Cache locality: https://en.wikipedia.org/wiki/Locality_of_reference Awesome CppCon talk: https://www.youtube.com/watch?v=2EWejmkKlxs SUPPORT ME ⭐ --------------------------------------------------- Patreon: https://patreon.com/mCoding Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Other donations: https://mcoding.io/donate Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G, Pieter G, Krisztian M, Sigmanificient BE ACTIVE IN MY COMMUNITY 😄 --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcoding CHAPTERS --------------------------------------------------- 0:00 Sorting 1:26 Cache locality 2:41 Vector traversal 4:39 Matrix multiplication 7:04 Branch predictability 9:56 Branchless optimization