Giter VIP home page Giter VIP logo

cpp-high-performance's Introduction

C++17 High Performance

This is the code repository for C++17 High Performance, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

C++ is an easy language and can be used to write complex applications and performance-critical code. It has evolved and changed over the last few years. This book will guide you through optimizing the performance of your C++ apps by allowing them to consume fewer resources on the device they’re running on.

The book begins with a gentle introduction to help you identify the bottlenecks in C++. We move on to measuring performance and you’ll see how this affects the way you write code. Next you’ll understand the importance of data structure optimization and how it can be used efficiently. After that, we’ll explain which algorithm should be used to achieve faster execution, followed by how to use STL containers.

Moving on, you’ll find out how to boost your code’s performance by executing compiled code. You’ll get hands-on making use of multiple cores to enable efficient and faster execution, including GPUs. After that, you’ll learn how to improve memory management in C++. We end with some techniques you can use to optimize the performance of your apps.

Instructions and Navigation

All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

The code will look like the following:

#include <iostream>

auto main() -> int {
  std::cout << "High Performance C++\n";
}

To get the most out of this book, you need to have a basic knowledge of C++. It's preferable if you have already been facing problems related to performance and are now looking for new tools and practices to have ready the next time you need to work with performance and C++.

There are a lot of code examples in this book. Some are taken from the real world, but most of them are artificial or vastly simplified examples to prove a concept rather than providing you with production-ready code. We have put all the code examples in source files divided by chapter so that it is fairly easy to find the examples you want to experiment with. If you open up the source code files, you will note that we have replaced most of the main() functions from the examples with test cases written with Google Test framework. We hope that this will help you rather than confuse you. It allowed us to write helpful descriptions for each example, and it also makes it easier to run all the examples from one chapter at once.

In order to compile and run the examples, you will need the following:

A computer An operation system (we have verified the examples on Windows and macOS) A compiler (we have been using Clang, GCC, and Microsoft Visual C++) CMake The CMake script provided with the example code will download and install further dependencies such as Boost, OpenCL, and Google Test.

During the writing of this book, it has been of great help for us to use Compiler Explorer, which is available at https://godbolt.org/. Compiler Explorer is an online compiler service that lets you try various compilers and versions. Try it out if you haven't already!

Related Products

Suggestions and Feedback

Click here if you have any feedback or suggestions.

cpp-high-performance's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.