Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
C++ High Performance
C++ High Performance

C++ High Performance: Master the art of optimizing the functioning of your C++ code , Second Edition

eBook
€31.99 €35.99
Paperback
€44.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

C++ High Performance

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Updated to C++20 with completely revised code and more content on error handling, benchmarking, memory allocators, and concurrent programming
  • Explore the latest C++20 features including concepts, ranges, and coroutines
  • Utilize C++ constructs and techniques to carry out effective data structure optimization and memory management

Description

C++ High Performance, Second Edition guides you through optimizing the performance of your C++ apps. This allows them to run faster and consume fewer resources on the device they're running on without compromising the readability of your codebase. The book begins by introducing the C++ language and some of its modern concepts in brief. Once you are familiar with the fundamentals, you will be ready to measure, identify, and eradicate bottlenecks in your C++ codebase. By following this process, you will gradually improve your style of writing code. The book then explores data structure optimization, memory management, and how it can be used efficiently concerning CPU caches. After laying the foundation, the book trains you to leverage algorithms, ranges, and containers from the standard library to achieve faster execution, write readable code, and use customized iterators. It provides hands-on examples of C++ metaprogramming, coroutines, reflection to reduce boilerplate code, proxy objects to perform optimizations under the hood, concurrent programming, and lock-free data structures. The book concludes with an overview of parallel algorithms. By the end of this book, you will have the ability to use every tool as needed to boost the efficiency of your C++ projects.

Who is this book for?

If you're a C++ developer looking to improve the efficiency of your code or just keen to upgrade your skills to the next level, this book is for you.

What you will learn

  • Write specialized data structures for performance-critical code
  • Use modern metaprogramming techniques to reduce runtime calculations
  • Achieve efficient memory management using custom memory allocators
  • Reduce boilerplate code using reflection techniques
  • Reap the benefits of lock-free concurrent programming
  • Gain insights into subtle optimizations used by standard library algorithms
  • Compose algorithms using ranges library
  • Develop the ability to apply metaprogramming aspects such as constexpr, constraints, and concepts
  • Implement lazy generators and asynchronous tasks using C++20 coroutines
Estimated delivery fee Deliver to Luxembourg

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 30, 2020
Length: 544 pages
Edition : 2nd
Language : English
ISBN-13 : 9781839216541
Category :
Languages :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Luxembourg

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Dec 30, 2020
Length: 544 pages
Edition : 2nd
Language : English
ISBN-13 : 9781839216541
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 158.97
Software Architecture with C++
€41.99
C++ High Performance
€44.99
Modern C++ Programming Cookbook
€71.99
Total 158.97 Stars icon

Table of Contents

16 Chapters
A Brief Introduction to C++ Chevron down icon Chevron up icon
Essential C++ Techniques Chevron down icon Chevron up icon
Analyzing and Measuring Performance Chevron down icon Chevron up icon
Data Structures Chevron down icon Chevron up icon
Algorithms Chevron down icon Chevron up icon
Ranges and Views Chevron down icon Chevron up icon
Memory Management Chevron down icon Chevron up icon
Compile-Time Programming Chevron down icon Chevron up icon
Essential Utilities Chevron down icon Chevron up icon
Proxy Objects and Lazy Evaluation Chevron down icon Chevron up icon
Concurrency Chevron down icon Chevron up icon
Coroutines and Lazy Generators Chevron down icon Chevron up icon
Asynchronous Programming with Coroutines Chevron down icon Chevron up icon
Parallel Algorithms Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(24 Ratings)
5 star 70.8%
4 star 16.7%
3 star 0%
2 star 8.3%
1 star 4.2%
Filter icon Filter
Top Reviews

Filter reviews by




N/A Feb 01, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very nice book full of insights on the use of modern c++ for efficient coding. Nicely written an plenty of examples.
Feefo Verified review Feefo
Amazon Customer Feb 22, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I was excited to see how this book covers C++; it has an emphasis on "high performance" and assumes familiarity with C++, and computer systems in general. It dives right into techniques to optimize C++ code, from data structures to memory management to concurrency and more, with lots of code examples to demonstrate concepts. I really liked how the book got close to low-level constructs, such as operating systems and assembly, so that the user could more fully understand what the C++ code was doing. If you haven't worked with C++ before then this might be a dense read. In my opinion, C++ is a pretty complex language and there's lots to unearth, and this book is all about understanding the intricacies of the language. If you want to expand your understanding of C++ and optimize your code through various means, then I think this book does a great job of showing how to do so!
Amazon Verified review Amazon
shukailin Feb 17, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book contains several topics including selected algorithm and data structure from STL, memory management, features of C++17 and 20, concurrency, template and more. In some topics, it not only introduces the features but also explain down to machine level so that the reader can get full background on why it has to be done in this way comparing with the other ways. It also mentions several useful tips for essential techniques in C++ which is quite common and useful when doing code review. The book also recommends readers to use https://godbolt.org/ which is a great tool to evaluate performance of different implementation. Also, one can find all the code used in the book on github which is a big plus since readers can easily evaluate it by themselves. I highly recommend this book to the C++ developer who has 2-3 years experience in C++!
Amazon Verified review Amazon
hawkinflight Jan 13, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I recently needed to interact with a C++ code base, and to come up to speed rapidly. Now, after having done that, I am looking at this book to add to what I learned. This is a very solid book. I am very happy that its goal is to focus on how to use the modern version of the language, C++20. There is a lot of material here, and it is thoughtfully and clearly presented.The first three chapters are very inviting and address topics of interest to me:Ch 1) Brief Introduction to C++ - answers "why C++?" and identifies features and drawbacks of the language, as well as the advantages and disadvantages as compared to other languagesCh 2) Essential C++ Techniques - presents modern and essential features of C++, features that one should know to use today's version of the languageCh 3) Analyzing and Measuring Performance - provides excellent material on comparing the efficiency of algorithms and data structures, also covers how to quantify performance by measuring latency and throughput, as well as how to identify hot spots using CPU profilers and how to improve isolated parts of the code by performing microbenchmarkings.The authors indicate that the remaining 11 chapters can be read independently. All of these remaining chapters look good to me, and the next four chapters cover basics which I don't want to skip:Ch 4) Data Structures - emphasizes checking the asymptotic complexity when choosing a data structure, and the importance of the cache level hierarchy in processors, and how it impacts how we need to organize the data for efficient memory accessCh 5) Algorithms - teaches how to use the basic concepts in the Algorithms library, and the advantages of using that library instead of handwriting for-loopsCh 6) Ranges and Views - presents using Range views to construct algorithms. "By using views, we can compose algorithms efficiently, and with a succinct syntax, using the pipe operator." A class can be a view and range adapters can be used to turn ranges into views.Ch 7) Memory Management - emphasizes the importance of understanding how your program uses memory, and advises that if you're facing memory issues, it's a good idea to check what's already available in libraries, since building custom memory managers that are fast, robust, and safe is a challenge. It is mentioned that "what you need" likely already exists, that someone else has probably had the same issue.Some interesting features of the last 7 chapters in the book are:Ch 8) Compile-time programming: demonstrates modern C++ techniques. By using templates, the constexpr, static_assert(), and if constexpr, type traits, and concepts to use metaprogramming to generate functions and values at compile time instead of runtime.Ch 9) Essential Utilities: combines essential classes from the C++ Utility library with containers and metaprogramming to store and iterate over elements of different types, as well as presents an example of implementing reflection, which is not built into C++, though it is planned to be included in future versions of the C++ standard, possibly in C++23.Ch 10) Proxy Objects and Lazy Evaluation - shows how to postpone the execution of certain code until required. Proxy objects can be used to leave exposed interfaces intact and enable optimizations to occur under the hood.Ch 11) Concurrency - provides an introduction to the C++ thread support library, the atomic library, andthe C++ memory model, a short example of lock-free programming, and performance guidelines, including advice on achieving low latency and high throughput. C++20 comes with some useful synchronization primitives: latches, barriers, and semaphore.Ch 12) Coroutines and Lazy Generators - the coroutines added to C++20 are stackless coroutines, though stackful coroutines can be used via third-party libraries. Stackless coroutines are closely related to state machines. A generator is a type of coroutine that yields values back to its caller, and are a way to build lazily evaluated sequences. An example demonstrates how to use C++ coroutines for building generators using the keywords co_yield and co_return.Ch 13) Asynchronous Programming with Coroutines - gives an introduction to the novel feature of asynchronouscoroutines in C++, and introduces a methodology called structured concurrency. It is noted that "although asynchronous programming is the most important driver for having coroutines in C++, there is no support forasynchronous tasks based on coroutines in the standard library", and it is recommended that a library that complements C++20 be used, such as CppCoro or Boost.Asio.Ch 14) Parallel Algorithms - are a way to speed up concurrent programs by utilizing multiple cores. Parallel execution of independent tasks is related to but distinct from concurrency. The parallelism should be abstracted away so that parallelizing code is only a matter of changing a parameter to an algorithm. The importance of parallelism and how to evaluate parallel algorithms is covered.Valuable final comments are provided about performance and the current compiler status for C++20:1) Performance - is an "important aspect of code quality. But too often, performance comes at the expense ofother quality aspects, such as readability, maintainability, and correctness. Solving performance problems usually comes down to a willingness to investigate things further. More often than not, it requires understanding the hardware and underlying OS well enough to be able to draw conclusions from measurement data."2) C++20 compiler support - one of the authors indicates that "a lot of the code presented in this book is only partially supported by the compilers today. I will keep updating the GitHub repository and adding information about compiler support."Really nice book.
Amazon Verified review Amazon
Wil C Oct 25, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Written at the right level of depth (not for beginners). Emphasizes modern idioms (C++20). Balanced, thoughtful advice. The comparative language analysis aids in compensation and helps weigh tradeoffs.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela