Compiler Confidential

Download this episode

Download Video

Download captions

Download Captions

Description

Modern CPU and instruction set architecture improvements are critical to the performance of software, but it's the compiler that can make your code sing. Come learn how compiler optimizations are enabling the next generation of native code performance. This talk will go deep into the guts of the Visual C++ compiler optimizer, focusing on compiler optimizations from the point of a view of modern CPUs. Down to the metal we go!

 

Day:

3

Code:

015

Embed

Format

Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image
      billatq

      Fantastic talk about compiler optimization internals.

    • User profile image
      cjlove

      Really enjoyed this talk!

    • User profile image
      vittoriorom​eo

      Just wanted to say this was one of my favorite talks! The explanation was very clear and concise and I just love learning about compiler internals and processor architecture. Thanks Eric!

    • User profile image
      Max

      11:35
      "...you can still have this situation...initialize std::vector by giving it a floating point pointer..."

      This is false, because different vectors will have distinct chunks of memory, because the data will be copied.

    • User profile image
      aklimkin

      Indirect call optimization replaces use of indirect branch predictor with common branch predictor. Which CPU the speedup was measure on?

    • User profile image
      EricBrumer

      Max: yes, you are right. But several things to keep in mind:
      1) The user can specify a custom allocator and do funny things with it. I'm not certain of the full implications of this.

      2) Even if all std::vector's declared in the program are unique by constructor, that doesn't preclude all overlap. Consider

      std::vector<int> v(...);
      bar(v, v);

      void bar(std::vector<int> &v1, std::vector<int> &v2) { /* can v1 & v2 overlap? sure... */ }

       

      aklimkin: I measured speedup on a Penryn W3520 (relatively old, so to speak) and a Haswell Core i5-4350U (relatively new). I am getting access to a very beefy Haswell chip pretty soon. I'll run my microbenchmark on that to see what happens.

      Keep in mind here that the real benefit is not just using the common branch predictor instead of using the indirect branch predictor. At the end of the day, the performance win comes because the compiler can (conditionally) inline function calls... and take advantage of the common branch predictor's capabilities.

      I may not have been as clear as I should have been in my talk about this.

    • User profile image
      KikiAlex

      a hint for the guy that is making the montage : when the speaker is changing the slides SHOW THE SLIDES, I know you think you are an artists but this is a programmers talk I need to see the slides in order to understand what he is talking about, I don't need to see him in order to understand what he is talking about.

    • User profile image
      Matthew Fioravante

      Eric, this talk was solid and your slides were great. I also looked up really enjoyed your other talk at build 2013.

      Would you consider a video series like STL does? I'd really like to hear professional advice on low level performance topics like Intel SSE and AVX assembly and compiler instrinsics. I think you have a lot of offer if you'd consider it.

      Thanks!

    • User profile image
      Tim

      I was going to comment that the runtime checks discussed on the slides seemed a bit conservative, but someone else in the audience already asked it (STL?).

    • User profile image
      Olaf van der Spek

      Is the HQ MP4 file broken? It's only 110 MB (115.637.670 bytes) for me.

    • User profile image
      Charles

      Is the HQ MP4 file broken? It's only 110 MB (115.637.670 bytes) for me.



      Nope. It's not corrupt, but it will be if your download fails for some reason....

      C

    • User profile image
      ProgramMax

      I really liked your talk, Eric. I went back and watched your other about memory, too. I wish there was more from you. Do you have a twitter account or something I can follow to get more? Thanks!

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.