performance

CppCon 2014 sqlpp11, An SQL Library Worthy Of Modern C++--Roland Bock

Have you registered for CppCon 2015 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 2014 for you to enjoy. Here is today’s feature:

sqlpp11, An SQL Library Worthy Of Modern C++

by Roland Bock

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

SQL and C++ are both strongly typed languages. They should play well together. But most C/C++ interfaces to SQL databases are string based. They force the developer to effectively hide the SQL types, names and expression structures from the compiler. This defers the validation of SQL expressions until runtime, i.e. unit tests or even production. And the strings might even be vendor specific, because different databases expect different dialects of SQL in those strings.

That feels wrong. Modern C++ can do better.

This talk gives an introduction to sqlpp11, a templated embedded domain specific language for SQL in C++. It allows you to build type-safe SQL expressions with type-safe results, all of which can be verified at compile time, long before your code enters unit tests or even production.

In addition to its obvious use with relational databases, sqlpp11 can also serve as an SQL frontend for all kinds of data sources: Since sqlpp11 offers complete SQL expression trees even at compile time, it isn't hard to apply SQL expressions to std::vector or std::map for instance, or streams, or XML, or JSON, you name it. With your help, sqlpp11 could become for C++ what LINQ is for C#.

CppCon 2014 C++ Memory Model Meets High-Update-Rate Data Structures--Paul E. McKenney

Have you registered for CppCon 2015 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 2014 for you to enjoy. Here is today’s feature:

C++ Memory Model Meets High-Update-Rate Data Structures

by Paul E. McKenney

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Highly performant and scalable techniques such as RCU and hazard pointers have been quite successful in read-mostly situations. However, there do come times when updates are necessary. It would be convenient if there was some general update-side counterpart to these techniques, but sadly there is not yet any such thing. Nevertheless, there are a number of specialized update-side techniques whose performance and scalability rival those of RCU and hazard pointers. This talk will discuss several of them, one of which is a solution to a challenge to the speaker at the 2014 Issaquah C++ standards committee meeting. This talk will also provide an outlook into the future of low-overhead scalable updates.

CppCon 2014 ODB, Advanced Weapons and Tactics--Boris Kolpackov

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:

ODB, Advanced Weapons and Tactics

by Boris Kolpackov

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Hiding a relational database behind an ORM does not work. Did I just say that? Yes! Performance and scalability limitations always get in the way. Should we then throw away the whole ORM idea and go back to SQL? We don't have to. In fact, the bulk of ODB features were specifically designed to resolve these limitations without degenerating to JOINs and SQL. And that's what the second part of this talk is all about: bulk operations, object caches, lazy pointers, views, change-tracking containers, optimistic concurrency, object sections (partitions), and prepared and cached queries. By the end of the second half you will be ready for anything that real-world C++ object persistence and database access can throw at you.

CppCon 2014 Efficiency with Algorithms, Performance with Data Structures--Chandler Carruth

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:

Efficiency with Algorithms, Performance with Data Structures

by Chandler Carruth

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Why do you write C++ code? There is a good chance it is in part because of concerns about the performance of your software. Whether they stem from needing to run on every smaller mobile devices, squeezing the last few effects into video game, or because every watt of power in your data center costs too much, C++ programmers throughout the industry have an insatiable desire for writing high performance code.

Unfortunately, even with C++, this can be really challenging. Over the past twenty years processors, memory, software libraries, and even compilers have radically changed what makes C++ code fast. Even measuring the performance of your code can be a daunting task. This talk will dig into how modern processors work, what makes them fast, and how to exploit them effectively with modern C++ code. It will teach you how modern C++ optimizers see your code today, and how that is likely to change in the coming years. It will teach you how to reason better about the performance of your code, and how to write your code so that it performs better. You will even learn some tricks about how to measure the performance of your code.

Cache-friendly binary search--Joaquín M López Muñoz

An interesting approach to sorted search:

Cache-friendly binary search

by Joaquín M López Muñoz

From the article:

High-speed memory caches present in modern computer architectures favor data structures with good locality of reference, i.e. the property by which elements accessed in sequence are located in memory addresses close to each other. This is the rationale behind classes such as Boost.Container flat associative containers, that emulate the functionality of standard C++ node-based associative containers while storing the elements contiguously (and in order)...

Set-up and tear-down--Andrzej Krzemieński

Today, you have an article about a specific aspect of unit-testing:

Set-up and tear-down

by Andrzej Krzemieński

From the article:

Recently as part of program run-time performance optimization effort, I was scanning through the code for occurrences of keyword new. The goal was to find unnecessary memory allocations. I was surprised to find most of news in the unit test module. Not that there was any particular need for memory allocation: it is just that the framework that was chosen (a fairly popular one) enforces on the programmers bad practices of manually controlling the life-time of their objects...

C++ on the Web: ponies for developers without pwn’ing users--JF Bastien

Another video coming from NDC:

C++ on the Web: ponies for developers without pwn’ing users

by JF Bastien

What you will find in the video:

Delivering a program through a web browser really shouldn't force it to be slower than executing it directly on your OS. Similarly, doing so shouldn't force you to rewrite programs that target venerable, cornerstone native programming APIs—modern C++ STL, OpenGL, files and processes—nor should it forbid you from taking advantage of C++’s concurrency and parallelism in order to meet programming challenges like resource-constrained devices, battery-starved devices, and high performance code. Oh, and the browser should keep users secure from malicious sites.
In this presentation we'll showcase some resource-intensive applications that have been compiled for the PNaCl platform and, unsurprisingly, worked just like native code. These include a full development environment, complete with LLVM and your favorite build system and editor, all in an architecture- and OS-agnostic packaging. Then, we'll describe how we deliver native code on the web securely, so developers get their C++ ponies and users don’t get pwn’d. We’ll also touch on the fuzzing, code randomization and sandboxing that keep 1B+ users safe.

Handling short codes — part II---Andrzej Krzemieński

Second 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 II

by Andrzej Krzemieński

From the article:

Today, we will continue with the implementation of a type capable of storing short codes. For the previous post on the subject see here. This time, we will focus on type safety...

CppCon 2014 Emscripten and asm.js: C++'s role in the modern web--Alon Zakai

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:

Emscripten and asm.js: C++'s role in the modern web

by Alon Zakai

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

All major web browsers are written in C++, but C++ is starting to fill an important role in web *content* as well: while JavaScript is the only standards-compliant language available to websites, compiling other languages to JavaScript has been shown to be practical and effective. This talk will explain how Emscripten, an LLVM-based open source compiler from C++ to JavaScript, lets you run a C++ codebase on the web at near-native speed. To achieve that level of performance, Emscripten emits asm.js, a strict subset of JavaScript that is easy for JavaScript engines to optimize, and was designed specifically as a compilation target for languages like C and C++. We'll also discuss some of the more challenging aspects of compiling C++ to JavaScript, stemming from the C++ language itself, libraries and toolchains, and some thoughts on possible solutions.

CppCon 2014 Parallelizing the Standard Algorithms Library--Jared Hoberock

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:

Parallelizing the Standard Algorithms Library

by Jared Hoberock

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Until recently, C++ programmers building parallel programs found little support for parallelism in the standard toolbox. That's changing with the technical specification on Extensions for Parallelism in C++. This talk will explore how programmers can build portable parallel programs from high-level parallel algorithms which can execute on CPU threads, vector units, and even GPUs.