Loading…
This event has ended. Visit the official site or create your own event on Sched.
View analytic

Log in to bookmark your favorites and sync them to your phone or calendar.

•Optimization and Undefined Behavior [clear filter]
Monday, September 25
 

2:00pm

When a Microsecond Is an Eternity: High Performance Trading Systems in C++
Automated trading involves submitting electronic orders rapidly when opportunities arise. But it’s harder than it seems: either your system is the fastest and you make the trade, or you get nothing.

This is a considerable challenge for any C++ developer - the critical path is only a fraction of the total codebase, it is invoked infrequently and unpredictably, yet must execute quickly and without delay. Unfortunately we can’t rely on the help of compilers, operating systems and standard hardware, as they typically aim for maximum throughput and fairness across all processes.

This talk describes how successful low latency trading systems can be developed in C++, demonstrating common coding techniques used to reduce execution times. While automated trading is used as the motivation for this talk, the topics discussed are equally valid to other domains such as game development and soft real-time processing.

Speakers
avatar for Carl Cook

Carl Cook

Software Engineer, Optiver
Carl has a Ph.D. from the University of Canterbury, New Zealand, graduating in 2006. He currently works for Optiver, a global electronic market maker, where he is tasked with adding new trading features into the execution stack while continually reducing latencies. Carl is also... Read More →


Monday September 25, 2017 2:00pm - 3:00pm
Berry Hall Meydenbauer Center
 
Tuesday, September 26
 

4:45pm

CNL: A Compositional Numeric Library
CNL is a numerics library born out of efforts to standardize fixed-point arithmetic.
It provides number types which increase precision, enforce correctness and maintain efficiency.
And by designing these types with composability in mind, the library aims to do for integers what the STL does for pointers.

This introductory talk will show potential users how they can benefit from using CNL in a wide variety of applications. Firstly, the individual components will be illustrated using straightforward examples. Then we'll see how these components slot together to produce powerful new types. Finally I'll detail the steps necessary to adapt existing types to work within the CNL framework.

Along the way, I hope to share some of the insights I've gained while learning about literal types including: why you shouldn't mess with `int` if you want zero-cost abstractions; how C++ is getting better at supporting new number types and my hopes for the forthcoming Numeric TS.

Speakers
avatar for John McFarlane

John McFarlane

SDE, A9.com
John McFarlane has used C++ for twenty years, specializing in simulation, AI and interactivity. He is a contributor to Study Groups 6 and 14 and is involved in standardizing fixed-point arithmetic.


Tuesday September 26, 2017 4:45pm - 5:45pm
Manchester (407) Meydenbauer Center

4:45pm

ThinLTO: Building C++ Applications with Scalable Whole Program Optimization
Whole program optimization enables higher performance in C++ applications, because of the expanded scope for analysis and optimization. However, the memory and time required to optimize the entire program together as a single unit traditionally has made whole program optimization infeasible for complex and large C++ applications, such as those being built at Google. Additionally, traditional whole program optimization frameworks have not supported fast incremental builds. ThinLTO (Thin Link Time Optimization) is a new compilation model that was recently deployed in the LLVM compiler toolchain to enable scalable whole program optimization for these huge C++ applications, and additionally enables the fast incremental builds required for use in day-to-day development.

In this talk we’ll describe why whole program optimization is beneficial for C++ applications, how the ThinLTO compilation model enables scalable and incremental builds, and how ThinLTO can be integrated with distributed build systems for even faster whole program builds. Additionally, we’ll describe implications for C++ developers.

Speakers
avatar for Teresa Johnson

Teresa Johnson

Software Engineer, Google
Teresa Johnson works on compiler optimization at Google. Prior to joining Google in 2011, she developed compiler optimizations for the Itanium compiler at HP, and received a PhD from the University of Illinois at Urbana-Champaign.


Tuesday September 26, 2017 4:45pm - 5:45pm
ENIAC (404) Meydenbauer Center
 
Wednesday, September 27
 

2:00pm

Undefined Behavior in 2017 (part 1 of 2)
Undefined behavior is a clear and present danger for all application code written in C++. The most pressing relevance is to security, but really the issue is one of general software correctness. The fundamental problem lies in the refusal of C++ implementations (in general) to trap or otherwise detect undefined behaviors. Since undefined behaviors are silent errors, many developers have historically misunderstood the issues in play.

Since the late 1990s undefined behavior has emerged as a major source of exploitable vulnerabilities in C++ code. This talk will focus on trends in the last few years including (1) increased willingness of compilers to exploit undefined behaviors to break programs in hard-to-understand ways and (2) vastly more sophisticated tooling that we have developed to detect and mitigate undefined behaviors. The current situation is still tenuous: only through rigorous testing and hardening and patching can C++ code be exposed to untrusted inputs, even when this code is created by strong development teams. This talk will focus on what developers can and should do to prevent and mitigate undefined behaviors in code they create or maintain.

Speakers
avatar for John Regehr

John Regehr

Professor, University of Utah
John Regehr is a professor of computer science at the University of Utah, USA. His research group creates tools for making software more efficient and correct. For example, one of his projects, Csmith, generates random C programs that have been used to find more than 500... Read More →


Wednesday September 27, 2017 2:00pm - 3:00pm
Ferranti (403) Meydenbauer Center

3:15pm

Undefined Behavior in 2017 (part 2 of 2)
Undefined behavior is a clear and present danger for all application code written in C++. The most pressing relevance is to security, but really the issue is one of general software correctness. The fundamental problem lies in the refusal of C++ implementations (in general) to trap or otherwise detect undefined behaviors. Since undefined behaviors are silent errors, many developers have historically misunderstood the issues in play.

Since the late 1990s undefined behavior has emerged as a major source of exploitable vulnerabilities in C++ code. This talk will focus on trends in the last few years including (1) increased willingness of compilers to exploit undefined behaviors to break programs in hard-to-understand ways and (2) vastly more sophisticated tooling that we have developed to detect and mitigate undefined behaviors. The current situation is still tenuous: only through rigorous testing and hardening and patching can C++ code be exposed to untrusted inputs, even when this code is created by strong development teams. This talk will focus on what developers can and should do to prevent and mitigate undefined behaviors in code they create or maintain.

Speakers
avatar for John Regehr

John Regehr

Professor, University of Utah
John Regehr is a professor of computer science at the University of Utah, USA. His research group creates tools for making software more efficient and correct. For example, one of his projects, Csmith, generates random C programs that have been used to find more than 500... Read More →


Wednesday September 27, 2017 3:15pm - 4:15pm
Ferranti (403) Meydenbauer Center
 
Thursday, September 28
 

9:00am

Type Punning in C++17: Avoiding Pun-defined Behavior
Type punning, treating a type as though it is a different type, has a long and sordid history in C and C++. But, as much as we'd like to deny its existence, it plays an important role in efficient low-level code. If you've ever written a program that examines the individual bits of a pointer or of a floating point number, then you've done type punning.

Given its long legacy, some of the techniques for type punning that were appropriate, even encouraged, earlier in history now live in the realm of undefined behavior. We'll identify which techniques are now proscribed and postulate why. We'll also explore ways to do type punning in C++17 that sidestep undefined behavior and are hopefully as efficient as the older techniques.

In this session we will look at:
o Common (and some uncommon) motivations for type punning.
o Techniques for type punning, both good and bad, all ugly.
o Related topics (like type conversions and std::launder()) with an eye toward unspecified and undefined behavior.

Speakers
avatar for Scott Schurr

Scott Schurr

Senior Software Engineer, Ripple
If you ask his children, they will tell you that Scott has been writing software since dinosaurs roamed the earth. In 1996 Scott learned C++ by working through the exercises in Stroustrup's TC++PL 2nd edition and he has never looked back. Scott is currently working at Ripple La... Read More →


Thursday September 28, 2017 9:00am - 10:00am
Ferranti (403) Meydenbauer Center
 
Friday, September 29
 

9:00am

Performance Benchmarking with Celero
Let's talk about performance optimization!  

Developing consistent and meaningful benchmark results for code is a complex task. Measurement tools exist (Intel® VTune™ Amplifier, SmartBear AQTime, Valgrind, etc.) external to applications, but they are sometimes expensive for small teams or cumbersome to utilize. Celero is a small library which can be added to a C++ project and perform benchmarks on code in a way which is easy to reproduce, share, and compare among individual runs, developers, or projects.

This talk will start with an overview of baseline benchmarking, how proper measurements are made, and offer guidelines for performance optimization. It will then walk developers through the process of developing benchmark code in a way similar to many unit testing libraries. Through practical examples, methods for benchmark design and debugging will be explored. We will then use the library to plot and understand the results.

In the end, attendees should feel comfortable exploring the use of Celero in their own projects and adding baseline benchmarking to their testing and delivery processes.

Speakers
avatar for John Farrier

John Farrier

Chief Engineer, Booz Allen Hamilton
John Farrier is a software engineer, researcher, and musician. He designs software architectures for military modeling and simulation activities. His projects support efforts across the U.S. Department of Defense ranging from lab-based experimental software to fielded software... Read More →


Friday September 29, 2017 9:00am - 10:00am
Harvard (406) Meydenbauer Center

9:00am

Undefined Behaviour is awesome!
Undefined behavior (UB) is one of the features of C++ that is both loved and hated. Every C++ developer cares about performance, which is why it is very important to understand what the compiler can optimize and what are the language guarantees. Many times programmers are too optimistic about what the compiler can optimize, or they waste time optimizing code by hand.

In this talk you will learn:
- what is the “as-if” rule
- why compilers know less than the programmer — the main problem with Translation Units
- why compilers optimize based on UB, but don't warn about it 
- why Undefined Behavior can transcend time, removing your whole code without running 88mph
- why having a more constrained language is better — optimizations that you can’t do in C



Speakers
avatar for Piotr Padlewski

Piotr Padlewski

SWE intern, Microsoft


Friday September 29, 2017 9:00am - 10:00am
Ferranti (403) Meydenbauer Center

10:30am

Understanding the runtime behaviors of C++ programs using uftrace tool
This talk will present the uftrace function graph tracing tool, which was first introduced at CppCon last year. The uftrace tool utilizes function instrumentation techniques from compilers to provide deeper understanding of execution behaviors in C/C++ programs.

uftrace provides multiple ways to analyze the runtime behavior of C/C++ programs and measures the execution time of each function without source code modification. In addition, uftrace is highly configurable and allows the user to apply numerous filters to any function in the program. The recorded trace data can be displayed in the console or in a graphical output such as chrome trace viewer or flamegraph.

In this talk, Honggyu will present the uftrace internals, recent changes and how it can be practically used on production quality C++ projects. For more information, please visit https://github.com/namhyung/uftrace.

Speakers
avatar for Honggyu Kim

Honggyu Kim

Software Engineer, LG Electronics
Honggyu Kim is a software engineer in LG Electronics and have been mainly working on software analysis and development tools. His interests are mainly in low-level embedded systems and he's also started working on JavaScript engines for webOS platform recently.


Friday September 29, 2017 10:30am - 11:00am
ENIAC (404) Meydenbauer Center

1:30pm

Going Nowhere Faster
You care about the performance of your C++ code. You have followed basic patterns to make your C++ code efficient. You profiled your application or server and used the appropriate algorithms to minimize how much work is done and the appropriate data structures to make it fast. You even have reliable benchmarks to cover the most critical and important parts of the system for performance. But you're profiling the benchmark and need to squeeze even more performance out of it... What next?

This talk dives into the performance and optimization concerns of the important, performance critical loops in your program. How do modern CPUs execute these loops, and what influences their performance? What can you do to make them faster? How can you leverage the C++ compiler to do this while keeping the code maintainable and clean? What optimization techniques do modern compilers make available to you? We'll cover all of this and more, with piles of code, examples, and even live demo.

While the talk will focus somewhat on x86 processors and the LLVM compiler, but everything will be broadly applicable and basic mappings for other processors and toolchains will be discussed throughout. However, be prepared for a lot of C++ code and assembly.

Speakers
avatar for Chandler Carruth

Chandler Carruth

Software Engineer, Google
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... Read More →


Friday September 29, 2017 1:30pm - 2:30pm
Berry Hall Meydenbauer Center