performance

CppCon 2014 A Deep Dive into 2 Cross-Platform Mobile Apps Written in C++--T. Grue & S. Kabbes

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

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

A Deep Dive into 2 Cross-Platform Mobile Apps Written in C++

by T. Grue & S. Kabbes

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

At Dropbox we’ve spent the last year and a half building two cross platform mobile apps: the email client, Mailbox, and the photo gallery, Carousel. We started with the goal of a native look and feel with seamless performance but also needed to leverage a small team to build these apps on multiple platforms. We ultimately accomplished this by using C++ to share significant amounts of code in each app.

We’ll cover what portions of our apps we built in C++ and why we left some portions in the platform languages of Java and Objective-C, deep diving into some of the most important components. We’ll also discuss some unexpected benefits, areas we faced technical and human challenges, and some tips and tricks that you can use to leverage C++ to build very high performance apps.

CppCon 2014 What did C++ do for Transactional Memory?--Michael Wong

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

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

What did C++ do for Transactional Memory?

by Michael Wong

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

SG5 is a Study Group within WG21 developing a promising new way to deal with mutable shared memory, that is expected to be more usable and scalable than current techniques based on atomics and mutexes. It promises to be as easy to use as coarse-grained locks, as scalable as fine-grained locks and yet remain composable.

Find out where on the Gartner hype cycle lives Transactional Memory.
Is it at the Peak of Inflated Expectations, Trough of Disillusionment, Slope of Enlightenment, or Plateau of Productivity?

For that matter, just how soon will I be able to use it with the new Intel Haswell, and IBM Power Hardware, or is it one of those mirages where the closer you get to your hardware, the further it moves away.

And is it true that one of the lead author of this TM proposal also wrote "Is it just a Research Toy?"

This 60 minute advanced talk will cover the history of Transactional Memory, various lock elision and optimistic speculation techniques, the technical engine behind Transactional Memory, the recent research in its use cases, usability and performance data that supports its entry into the C++ Standard, and of course the latest details of the SG5 Technical Specification, including our effort at transactionalizing the C++ Standard Library.

CppCon 2014 Microsoft w/ C++ to Deliver Office Across Different Platforms, Part II—Zaika Antoun

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

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

Microsoft w/ C++ to Deliver Office Across Different Platforms, Part II

by Zaika Antoun

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

What does it take to target multiple major mobile devices (as well as traditional environments) with portable, efficient, single-source code? This talk demonstrates architectures, techniques, and lessons learned rooted in actual experience with using C++ to deliver several major cross-platform projects across iOS, Android, Windows, and Mac: Microsoft Office (Word, Excel, PowerPoint, OneNote) and the SQL Server PowerBI. Each presents a different case study: For example, Office already used C++, whereas PowerBI was originally written in Silverlight and then rewritten in C++; Office is a set of user-facing apps, whereas PowerBI is a system component. Although some of these are demanding first-tier “Cadillac” applications, we expect this experience to be a model for the future as more and more apps fall into this category and use C++ to target many popular platforms from (mostly) a single source base. This talk will cover the following key topics and tradeoffs: Rich vs. reach, including access to latest OS features (e.g., iOS 8 additions) and hardware features (e.g., vector units, GPUs). Consistency of functionality. Client code vs. server/service web code. Sharing vs. quality, including dialing appropriately between more shared code and high quality code. Drawing the line between the bulk of C++ code and interfacing with non-C++ for UX and PALs (platform adaptation/abstraction layers) for target-specific user interface and system services. Architecting PALs, including why “mini-PALs” rather than an “über-PAL.” Forces “doing the right thing” and good architecture with composable components. How C++ enables things not feasible using other technologies. Velocity and enabling faster cross-platform development and deployment. Cost of maintenance, including time, size, and complexity (both breadth and depth). And, last but not least, developing in a single modern C++ source base built with different evolving C++ compilers, including VC++ and Clang/LLVM.

Mach7: Pattern Matching for C++

Here is a new library to perform pattern matching:

Mach7: Pattern Matching for C++

by Yuriy Solodkyy, Gabriel Dos Reis and Bjarne Stroustrup

From the article:

Pattern matching is an abstraction mechanism that can greatly simplify source code. Commonly, pattern matching is built into a language to provide better syntax, faster code, correctness guarantees and improved diagnostics. Mach7 is a library solution to pattern matching in C++ that maintains many of these features. All the patterns in Mach7 are user-definable, can be stored in variables, passed among functions, and allow the use of open class hierarchies...

Example:

// Fibonacci numbers
int fib(int n)
{
    var<int> m;

    Match(n)
    {
      Case(1)     return 1;
      Case(2)     return 1;
      Case(2*m)   return sqr(fib(m+1)) - sqr(fib(m-1));
      Case(2*m+1) return sqr(fib(m+1)) + sqr(fib(m));
    }
    EndMatch
}

CppCon 2014 Microsoft w/ C++ to Deliver Office Across Different Platforms, Part I--Zaika Antoun

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Microsoft w/ C++ to Deliver Office Across Different Platforms, Part I

by Zaika Antoun

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

What does it take to target multiple major mobile devices (as well as traditional environments) with portable, efficient, single-source code? This talk demonstrates architectures, techniques, and lessons learned rooted in actual experience with using C++ to deliver several major cross-platform projects across iOS, Android, Windows, and Mac: Microsoft Office (Word, Excel, PowerPoint, OneNote) and the SQL Server PowerBI. Each presents a different case study: For example, Office already used C++, whereas PowerBI was originally written in Silverlight and then rewritten in C++; Office is a set of user-facing apps, whereas PowerBI is a system component. Although some of these are demanding first-tier “Cadillac” applications, we expect this experience to be a model for the future as more and more apps fall into this category and use C++ to target many popular platforms from (mostly) a single source base. This talk will cover the following key topics and tradeoffs: Rich vs. reach, including access to latest OS features (e.g., iOS 8 additions) and hardware features (e.g., vector units, GPUs). Consistency of functionality. Client code vs. server/service web code. Sharing vs. quality, including dialing appropriately between more shared code and high quality code. Drawing the line between the bulk of C++ code and interfacing with non-C++ for UX and PALs (platform adaptation/abstraction layers) for target-specific user interface and system services. Architecting PALs, including why “mini-PALs” rather than an “über-PAL.” Forces “doing the right thing” and good architecture with composable components. How C++ enables things not feasible using other technologies. Velocity and enabling faster cross-platform development and deployment. Cost of maintenance, including time, size, and complexity (both breadth and depth). And, last but not least, developing in a single modern C++ source base built with different evolving C++ compilers, including VC++ and Clang/LLVM.

Handling short codes (part I)--Andrzej Krzemieński

First part of a discussion about designing a type storing character strings of length N (known at compile-time and sufficiently small).

Handling short codes - part I

by Andrzej Krzemieński

From the article:

In my work, we often deal with codes [...] The initial choice was to represent them in programs by type std::string, a general-purpose type for storing sequences of characters. But, as with any general-purpose tools, they fail to take into account the particular usage cases which often offer room for improvements [...] The following is an attempt at the design of a type that would take advantage of the information that we are only storing character strings of length N, where N is sufficiently small (say, no longer than 8)...

CppCon 2014 Optimization Tips - Mo' Hustle Mo' Problems--Andrei Alexandrescu

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Optimization Tips - Mo' Hustle Mo' Problems

by Andrei Alexandrescu

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Reasonably-written C++ code will be naturally fast. This is to C++'s excellent low-penalty abstractions and a memory model close to the machine.

However, a large category of applications have no boundaries on desired speed, meaning there's no point of diminishing returns in making code faster. Better speed means less power consumed for the same work, more workload with the same data center expense, better features for the end user, more features for machine learning, better analytics, and more.

Optimizing has always been an art, and in particular optimizing C++ on contemporary hardware has become a task of formidable complexity. This is because modern hardware has a few peculiarities about it that are not sufficiently understood and explored. This talk discusses a few such effects, and guides the attendee on how to navigate design and implementation options in search for better performance.

CppCon 2014 Lock-Free Programming (or, Juggling Razor Blades), Part II--Herb Sutter

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Lock-Free Programming (or, Juggling Razor Blades), Part II

by Herb Sutter

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Example-driven talk on how to design and write lock-free algorithms and data structures using C++ atomic -- something that can look deceptively simple, but contains very deep topics. (Important note: This is not the same as my "atomic Weapons" talk; that talk was about the "what they are and why" of the C++ memory model and atomics, and did not cover how to actually use atomics to implement highly concurrent algorithms and data structures.)

CppCon 2014 Lock-Free Programming (or, Juggling Razor Blades), Part I--Herb Sutter

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Lock-Free Programming (or, Juggling Razor Blades), Part I

by Herb Sutter

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Example-driven talk on how to design and write lock-free algorithms and data structures using C++ atomic -- something that can look deceptively simple, but contains very deep topics. (Important note: This is not the same as my "atomic Weapons" talk; that talk was about the "what they are and why" of the C++ memory model and atomics, and did not cover how to actually use atomics to implement highly concurrent algorithms and data structures.)