CppCon 2015: Chandler Carruth "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!"

Поділитися
Вставка
  • Опубліковано 26 вер 2015
  • www.Cppcon.org
    -
    A primary use case for C++ is low latency, low overhead, high performance code. But C++ does not give you these things for free, it gives you the tools to control these things and achieve them where needed. How do you realize this potential of the language? How do you tune your C++ code and achieve the necessary performance metrics?
    This talk will walk through the process of tuning C++ code from benchmarking to performance analysis. It will focus on small scale performance problems ranging from loop kernels to data structures and algorithms. It will show you how to write benchmarks that effectively measure different aspects of performance even in the face of advanced compiler optimizations and bedeviling modern CPUs. It will also show how to analyze the performance of your benchmark, understand its behavior as well as the CPUs behavior, and use a wide array of tools available to isolate and pinpoint performance problems. The tools and some processor details will be Linux and x86 specific, but the techniques and concepts should be broadly applicable.
    --
    Chandler Carruth leads the Clang team at Google, building better diagnostics, tools, and more. Previously, he worked on several pieces of Google’s distributed build system. He makes guest appearances helping to maintain a few core C++ libraries across Google’s codebase, and is active in the LLVM and Clang open source communities. He received his M.S. and B.S. in Computer Science from Wake Forest University, but disavows all knowledge of the contents of his Master’s thesis. He is regularly found drinking Cherry Coke Zero in the daytime and pontificating over a single malt scotch in the evening.
    --
    Videos Filmed & Edited by Bash Films: www.BashFilms.com
    *-----*
    Register Now For CppCon 2022: cppcon.org/registration/
    *-----*

КОМЕНТАРІ • 65

  • @syferpolski4344
    @syferpolski4344 4 роки тому +30

    1:29:40

  • @j7gy8b
    @j7gy8b 5 років тому +32

    For my own notes (and anyone else's!) Chandler's recommended flags for record and report are at

  • @movax20h
    @movax20h 4 роки тому +20

    BTW. There is a shortcut in `perf` to use inverted callgraph. `perf report -G`. You still need to record with `perf record -g` of course and have some debug info present in the binary (if needed use -Og and/or -ggdb and/or -fno-omit-frame-pointer, or some combination, but be careful as some of these options might impact measurements itself).

  • @S9uareHead
    @S9uareHead 4 роки тому +16

    I agree with perf's decision to display the most expensive callees first (see the discussion at ~32 minutes). It's what you need to initially know. If your reaction is "WTF this function isn't supposed to show up in the list at all", you immediately know that it's way too expensive or called in places you don't expect.

  • @TimTeatro
    @TimTeatro 8 років тому +47

    A link to Bryce Adelstein-Lelbach “Benchmarking C++ Code" that Chandler mentions in his intro:

  • @chaosteil
    @chaosteil 8 років тому +7

    Chandler Carruth is my spirit animal.

  • @ZarviroffSerge
    @ZarviroffSerge 8 років тому +4

    This is extremely brilliant!

  • @victornoagbodji
    @victornoagbodji 8 років тому +17

    guy is simply amazing : )

  • @kamilziemian995
    @kamilziemian995 Рік тому +1

    This is a great talk, even while I don't understand 50% or more of it.

  • @EGoksy
    @EGoksy 8 років тому +25

    Run on (48 x 2717.5MHz CPU s)

  • @kamilziemian995
    @kamilziemian995 Рік тому

    I'm on the way to watch all Chandler Carruth's talks on YT.

  • @joripiira
    @joripiira 7 років тому +18

    This is what I want. Superb in it's diving the matter deeply.

  • @Peter_Cordes
    @Peter_Cordes 5 років тому +9

    counts for "cycles" often seem to get attributed to the instruction that gets stuck waiting for the result (reads that register), not just the next instruction in program order. At least that's true for cache-miss loads. At

  • @mrexodia
    @mrexodia 4 роки тому +12

    Here is the talk about macro benchmarking that's mentioned in the beginning:

  • @NirmalGeorge
    @NirmalGeorge 8 років тому

    Amazing! :)

  • @dreadlock205
    @dreadlock205 8 років тому +8

    Go to C++ talk and ask what kind of vim setup he uses :D

  • @Yupppi

    Imagine being at google for the second week and you get Ken Thompson's code that was basically addressed to you. I'm sure it was beautiful.

  • @llothar68
    @llothar68 8 років тому +2

    Fast forward. I like his speed as i drink beer while watching.

  • @AndersonSilva-dg4mg
    @AndersonSilva-dg4mg 4 роки тому +1

    cool video

  • @_msnnanbakbshhsn
    @_msnnanbakbshhsn 6 років тому +1

    Is there a profiler from LLVM ?