performance

CppCon 2016: Practical Performance Practices—Jason Turner

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

Practical Performance Practices

by Jason Turner

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

In the past 6 years ChaiScript's performance has been improved by nearly 100x. This was not accomplished by adding a virtual machine or performing dynamic recompilation. Instead, these increases have been accomplished by moving to more simple, cleaner, idiomatic C++ and by following some simple rules. We will outline these concepts with examples for how they both simplified code while improving performance.

There Is A New Future—Felix Petriconi

Version 1.0 of a new C++ future and channel library has been released.

There Is A New Future

by Sean Parent, Foster Brereton and Felix Petriconi

About the library:

This library provides high level abstractions for implementing algorithms that eases the use of multiple CPU cores while minimizing the contention.

The future implementaton differs in several aspects compared to the C++11/14/17 standard futures: It provides continuations and joins, which were just added in a C++17 TS. But more important this futures propagate values through the graph and not futures. This allows an easy way of creating splits. That means a single future can have multiple continuations into different directions. An other important difference is that the futures support cancellation. So if one is not anymore interested in the result of a future, then one can destroy the future without the need to wait until the future is fullfilled, as it is the case with std::future (and boost::future). An already started future will run until its end, but will not trigger any continuation. So in all these cases, all chained continuations will never be triggered. Additionally the future interface is designed in a way, that one can use build in or custom build executors.

Since one can create with futures only graphs for single use, this library provides as well channels. With these channels one can build graphs, that can be used for multiple invocations.

CppCon 2016: Game engine using STD C++ 11—Jason Jurecka

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

Game engine using STD C++ 11

by Jason Jurecka

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

This session is going to give an account of the process and features used to create a game engine focusing on using std C++11 features and concurrency. We will go through the architecture of the engine design and the specifics of the C++11 features being used. We will also go through optimization choices and design mentalities that are being used to keep the code base simple, but powerful in game usage. The engine architecture we will be going through will be using parallelism as a way to distribute work and get performance out of the available hardware that can scale into the future.

While completing a full engine with cutting edge graphics techniques and a game to push the engine to its limits will take a while this session will go over the current state of the project and lessons learned. The ultimate goal of the project is to show the validity of using C++11 (and beyond) features in game engines to simplify code and improve stability while maintaining the performance and memory usage games demand.

CppCon 2016: Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17—Jason Turner

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17

by Jason Turner

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

The Commodore 64 was released in 1982 and is the best selling computer model of all time. At 34 years old, even the most simple embedded processor today outperforms it. Join me on an exploration of how C++17 techniques can be utilized to write expressive, high performance, high level code for simple computers. Together we will create a game for this aging system.

You'll leave the talk with a better understanding of what your compiler is capable of and be able to apply these ideas to create better code on modern systems.

A self-contained Pool in C++14—Jens Weller

How to do a pool?

A self-contained Pool in C++14

by Jens Weller

From the article:

During C++Now I started writing a small application, that plays around with dlibs face recognition features. More on this later, the program uses the QThreadPool, and some researched showed that calling dlib::get_frontal_face_detector() is a very expensive operation. So I decided to write a thread safe pool to share the face detection object between threads, only loading as many as needed. The main thread owns the pool which owns the detection objects...

Accelerating your C++ on GPU with SYCL—Simon Brand

A post on writing GPGPU code in C++ using the SYCL standard from the Khronos group.

Accelerating your C++ on GPU with SYCL

By Simon Brand

From the article:

Leveraging the power of graphics cards for compute applications is all the rage right now in fields such as machine learning, computer vision and high-performance computing. Technologies like OpenCL expose this power through a hardware-independent programming model, allowing you to write code which abstracts over different architecture capabilities. The dream of this is “write once, run anywhere”, be it an Intel CPU, AMD discrete GPU, DSP, etc. Unfortunately, for everyday programmers, OpenCL has something of a steep learning curve; a simple Hello World program can be a hundred or so lines of pretty ugly-looking code. However, to ease this pain, the Khronos group have developed a new standard called SYCL, which is a C++ abstraction layer on top of OpenCL. Using SYCL, you can develop these general-purpose GPU (GPGPU) applications in clean, modern C++ without most of the faff associated with OpenCL.

Better C++ / Chicago July 12-14, 2017

Join us for a 3 day training event in Chicago, IL, USA July 12-14, 2017

Better C++ / Chicago

by Jason Turner

About the training:

Through this training you will gain a better understanding of how to write clean, maintainable, and well performing C++ code.

The topics covered apply to all types of C++ development: embedded, system or application development.

Jason's classes are highly interactive and have a limited class size to ensure that everyone has sufficient opportunity to participat

A la carte tickets are available for those wishing to attend only part of the training.

Wednesday: Demystifying C++11 and Beyond

C++11, 14, and 17 added many new features to C++ that have made many question the overhead of using these new features and the complexity they add to the language. We will make an in depth examination of these features to give you confidence in using and deploying modern C++ techniques in your organization.

Thursday: Understanding Object Lifetime in C++

C++ has what very few other languages have: a well defined object life cycle. Understanding this key aspect of the language is critical for writing high quality C++.
We will describe the lifecycle of an object in C++ and work through increasingly complex examples. There will be something for C++ developers of all skill levels to learn.

Friday: C++ Best Practices

On the final day of the course we will cover a series of tangible best practice rules for how to write C++ code that is maintainable and efficient by default.
We will wrap up with a discussion of how to use the tools available to maintain code quality.

Frozen - An header-only, constexpr alternative to gperf for C++14 users—Serge Guelton

Check this out!

Frozen - An header-only, constexpr alternative to gperf for C++14 users

by Serge Guelton

From the article:

An open source, header-only library that provides fast, immutable, constexpr-compatible implementation of std::set, std::map, std::unordered_map and std::unordered_set to C++14 users. It can be used as an alternative to gperf...

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

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

Want fast C++? Know your hardware!

by Timur Doumler

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

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.