Skip to content
0:00 / 0:00

#cachelocality#branchprediction#simd

CppCon 2016: Timur Doumler “Want fast C++? Know your hardware!"

CppCon

189K subscribers • 123 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Timur Doumler
  • Linked in the descriptioncppcon/cppcon2016

Intermediate. Assumes working knowledge.

201K views10 years ago2 recommendations

Systems programmingHardwareC++Performance and optimizationCPUs and computer architecture

Timur Doumler explains how modern hardware properties like cache locality, branch prediction, and SIMD impact C++ performance.

CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/cppcon/cppcon2016 — As C++ evolves, it provides us with better and more powerful tools for optimal performance. But often, knowing the language very well is not enough. It is just as important to know your hardware. Modern computer architectures have many properties that can impact the performance of C++ code, such as cache locality, cache associativity, true and false sharing between cores, memory alignment, the branch predictor, the instruction pipeline, denormals, and SIMD. In this talk, I will give an overview over these properties, using C++ code. I will present a series of code examples, highlighting different effects, and benchmark their performance on different machines with different compilers, sometimes with surprising results. The talk will draw a picture of what every C++ developer needs to know about hardware architecture, provide guidelines on how to write modern C++ code that is cache-friendly, pipeline-friendly, and well-vectorisable, and highlight what to look for when profiling it. — Timur Doumler ROLI Ltd. JUCE Senior Software Engineer London, UK Timur Doumler is Senior Software Developer at London-based technology company ROLI. He is currently working on JUCE, the leading cross-platform framework for creating audio applications used by hundreds of companies in the audio industry. After five years of writing high-performance code in Fortran, C, and C++ for numerical simulations of the cosmic structure formation, Timur became committed to audio and music production software. Before joining ROLI, he worked on various projects at market-leading company Native Instruments, such as KONTAKT, the industry standard sampling platform used by the majority of music producers and composers for film score, games, and contemporary popular music. Timur holds a PhD in astrophysics and is passionate about well-written code, modern C++ techniques, science-fiction, learning languages, and progressive rock music. — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf

Why it's here

2 people recommend this

What people say. Recommended as an excellent talk on hardware-aware optimization principles for C and C++ developers.

Moments people linked to

u/Animaniac888in r/C_Programming • Recommends

On “Performance Optimization”

There are some good talks from cppcon on optimization. Even though they're C++ instead of C, they show good optimization principles. Some examples: link to this video link to this video link to this video

u/WrongAndBeligerentin r/GraphicsProgramming • Recommends

On “why do today's 3D implementations use float decimals instead of fixed point decimals?”

…picture again, floats are a direct way of doing the math needed for 3D rendering and trying to hack around integers is at best going to gain almost no speed, but is more likely to slow things down. It would be like taking the floor mats out of a car to save speed but much more difficult to get right. Two videos on memory latency and prefetching: link to this video link to this video > fun fact: my friend from higher year tells me GPUs sacrificed a bit of precision on floating point addition to make them 3clocks instead of 4 clocks I doubt this is true since GPUs follow the same floating point standards as everything else, so you may want to ask why he thinks that. https://en.wikipedia.org/wiki/IEEE_754…
1View on Reddit