Video available: Chandler Carruth, "Tuning C++: Benchmarks, and CPUs, and Compilers!" -- CppCon

Chandler's talk about benchmarking, cheating the compiler's optimizer and optimizing code from the recent CppCon is online.

Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My! (YouTube)

by Chandler Carruth, CppCon 2015

From the talk's outline:

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.

The Problem, The Culprits, The Hope--Tony “Bulldozer00” (BD00) DaSilva

This is another call to all C++ programmers, it is time to change!

The Problem, The Culprits, The Hope

by Tony “Bulldozer00” (BD00) DaSilva

From the article:

Bjarne Stroustrup’s keynote speech at CppCon 2015 was all about writing good C++11/14 code. Although “modern” C++ compilers have been in wide circulation for four years, Bjarne still sees:

I’m not an elite, C++ committee-worthy, programmer, but I can relate to Bjarne’s frustration...

Interview with Bjarne Stroustrup at CppCon this week

stroustrup-cppcon2015-i.jpgRecorded at CppCon this week:

Going Native 42: Bjarne Stroustrup interview at CppCon

Interviewed by Steve Carroll, development manager for Visual C++

The 42nd episode is here with a special guest: Bjarne Stroustrup is joining us from CppCon to share more about his historic CppCon keynote this week. His focus is on how we can all write good C++14 code.

Interview highlights:

  • [02:13] What is the keynote about?
  • [02:47] How do we write modern C++ code?
  • [03:46] Guideline support library and Static analysis
  • [04:39] Call to action for the C++ community!
  • [05:34] Enhancing productivity by eliminating whole classes of bugs
  • [06:01] Extending the C++ core guidelines
  • [07:44] What do you expect from these static analysis checkers?
  • [10:47] How can I get started?
  • [14:47] Other talks about this at cppcon

Video available: Sean Parent, "Better Code: Data Structures" -- CppCon 2015 Wednesday keynote

parent-cppcon15-v.PNGThe wonderful week of CppCon 2015 has just concluded, and we now have the Wednesday keynote video available below. (Reminder: All the sessions, panels, and lightning talks are being professionally recorded and will be available online worldwide for free. Like last year, expect them about a month after the conference ends. We're making a special effort to make the daily keynote/plenary sessions available early.)

Here it is:

Better Code: Data Structures (YouTube)

by Sean Parent, CppCon 2015 day 3 keynote

The standard library containers are often both misused and underused. Instead of creating new containers, applications are often structured with incidental data structures composed of objects referencing other object. This talk looks at some of the ways the standard containers can be better utilized and how creating (or using non-standard library) containers can greatly simplify code. The goal is no incidental data structures.

Related (other CppCon 2015 videos posted early):

We hope posting these few highlights during and shortly following CppCon can help to let everyone in the worldwide C++ community share in the news and feel a part of the gathering here in the Seattle neighborhood this week. Even if you couldn't be here in person this year to enjoy the full around-the-clock technical program and festival atmosphere, we hope you enjoy this nugget in the video presentation.

Bitesize Modern C++ : noexcept--Glennan Carnie

What is the use of noexcept?

Bitesize Modern C++ : noexcept

by Glennan Carnie

From the article:

We have some basic problems when trying to define error management in C:

  • There is no “standard” way of reporting errors. Each company / project / programmer has a different approach
  • Given the basic approaches, you cannot guarantee the error will be acted upon.
  • There are difficulties with error propagation; particularly with nested calls.

The C++ exception mechanism gives us a facility to deal with run-time errors or fault conditions that make further execution of a program meaningless...

Video available: Herb Sutter, "Writing Good C++14 by Default" -- CppCon 2015 day 2 plenary session

sutter-cppcon15-v.PNGCppCon is in full swing, and once again all the sessions, panels, and lightning talks are being professionally recorded and will be available online worldwide for free. Like last year, expect them about a month after the conference ends.

This year the team is trying to get a few of the big talks up early while still busily recording the 100+ others still in progress. Yesterday, they posted Bjarne Stroustrup's opening keynote video less than 48 hours after the live talk, and we're pleased to see that as of this writing over 10,000 of you have already enjoyed it online in its first day!

Today, the team posted the video for Herb Sutter's Day 2 plenary talk, which he described as "part 2 of Bjarne's keynote" with a focus on type and memory safety with live demos. If you couldn't be at CppCon on Tuesday in person, we hope you enjoy it:

Writing Good C++14... by Default (YouTube) (slides)

by Herb Sutter, CppCon 2015 day 2 plenary session

This talk continues from Bjarne Stroustrup’s Monday keynote to describe how the open C++ core guidelines project is the cornerstone of a broader effort to promote modern C++. Using the same cross-platform effort Stroustrup described, this talk shows how to enable programmers write production-quality C++ code that is, among other benefits, type-safe and memory-safe by default -- free of most classes of type errors, bounds errors, and leak/dangling errors -- and still exemplary, efficient, and fully modern C++.

Related:

We hope posting these few highlights while CppCon is still in progress can help to let everyone in the worldwide C++ community share in the news and feel a part of the gathering here in the Seattle neighborhood this week. Even if you couldn't be here in person this year to enjoy the full around-the-clock technical program and festival atmosphere, we hope you enjoy this nugget in the video presentation.

Video available: Bjarne Stroustrup, "Writing Good C++14" -- CppCon 2015 opening keynote

stroustrup-cppcon2015-v.jpgCppCon is in full swing, and once again all the sessions, panels, and lightning talks are being professionally recorded and will be available online -- about a month after the conference, because it takes time to process over 100 talks!

However, because of the importance of Bjarne's open keynote announcements on Monday, the team has pulled out the stops to process his video and get it up on YouTube (and maybe soon also Channel 9 for areas where YouTube is not available). It's there now, so if you couldn't be at CppCon on Monday in person, check it out:

Writing Good C++14 (YouTube) (slides)

by Bjarne Stroustrup, CppCon 2015 opening keynote

Related: Bjarne Stroustrup announces C++ Core Guidelines

The team says that they may also fast-track the other daily keynote/plenary sessions as well, some of which are directly related to Bjarne's keynote. If that happens, we'll post links here too. In the meantime, enjoy Bjarne's groundbreaking talk -- as one CppCon attendee and longtime C++-er said, "this is one of the most exciting weeks for C++ I can remember." We agree.

Bjarne Stroustrup announces C++ Core Guidelines

This morning in his opening keynote at CppCon, Bjarne Stroustrup announced the C++ Core Guidelines (github.com/isocpp/CppCoreGuidelines), the start of a new open source project on GitHub to build modern authoritative guidelines for writing C++ code. The guidelines are designed to be modern, machine-enforceable wherever possible, and open to contributions and forking so that organizations can easily incorporate them into their own corporate coding guidelines.

The initial primary authors and maintainers are Bjarne Stroustrup and Herb Sutter, and the guidelines so far were developed with contributions from experts at CERN, Microsoft, Morgan Stanley, and several other organizations. The guidelines are currently in a “0.6” state, and contributions are welcome. As Stroustrup said: “We need help!”

Stroustrup said: “You can write C++ programs that are statically type safe and have no resource leaks. You can do that without loss of performance and without limiting C++’s expressive power. This supports the general thesis that garbage collection is neither necessary nor sufficient for quality software. Our core C++ guidelines makes such code simpler to write than older styles of C++ and the safety can be validated by tools that should soon be available as open source.”

From Stroustrup’s talk abstract:

In this talk, I describe a style of guidelines that can be deployed to help most C++ programmers... The rules are prescriptive rather than merely sets of prohibitions, and about much more than code layout... The core guidelines and a guideline support library reference implementation will be open source projects freely available on all major platforms (initially, GCC, Clang, and Microsoft).

Although the repository was not officially announced until today, it was made public last week and was noticed: CppCoreGuidelines was the #1 trending repository worldwide on GitHub on Friday, and is currently the #1 trending repository worldwide for the past week, across all languages and projects.

Stroustrup also announced two other related projects.

Guideline Support Library (GSL): First, the C++ Core Guidelines also specifies a small Guideline Support Library (GSL), a set of common types like array_view and not_null to facilitate following the modern guidelines. An initial open source reference implementation contributed and supported by Microsoft is now available on GitHub at github.com/Microsoft/GSL. It is written in portable C++ that should work on any modern compiler and platform, and has been tested on Clang/LLVM 3.6 and GCC 5.1 for Linux, with Xcode and GCC 5.2.0 for OS X, and with Microsoft Visual C++ 2013 (Update 5) and 2015 for Windows. This is both a supported library and an initial reference implementation; other implementations by other vendors are encouraged, as are forks of and contributions to this implementation.

Checker tool: Second, the C++ Core Guidelines are designed to be machine-enforceable wherever possible, and include many rules that can be checked by a compiler, lint, or other tool. An initial implementation based on Microsoft’s Visual Studio will be demonstrated in several talks at CppCon this week, including Herb Sutter’s Day 2 plenary session tomorrow morning. This implementation will be made available as a Windows binary in October, with the intention to open source the implementation thereafter. This too will become a supported tool and an initial reference implementation open to others; other implementations by other vendors of compilers, linters, and other tools are encouraged.

A number of other CppCon talks will go deeper into the related topics, notably the following talks by speakers who collaborated on the Guidelines effort:

Herb Sutter: Writing Good C++14 by Default (Tue 10:30am)

Gabriel Dos Reis: Large Scale C++ with Modules: What You Should Know (Tue 2:00pm)

Neil MacIntosh: More Than Lint: Modern Static Analysis for C++ (Wed 2pm)

Neil MacIntosh: A Few Good Types: Evolving array_view and string_view for Safe C++ Code (Wed 3:15pm)

Gabriel Dos Reis: Contracts for Dependable C++ (Wed 4:45pm)

Eric Niebler: Ranges and the Future of the STL (Fri 10:30am)

(and more)

If you’re at CppCon this week, watch for those talks. If you aren’t, like last year’s event, CppCon 2015 is again professionally recording all talks, and they will be freely available online about a month after the conference.