The Art of Writing Efficient Programs: An advanced programmer's guide to efficient hardware utilization and compiler optimizations using C++ examples

Pikus, Fedor G.

  • 出版商: Packt Publishing
  • 出版日期: 2021-10-22
  • 定價: $1,680
  • 售價: 9.0$1,512
  • 語言: 英文
  • 頁數: 452
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1800208111
  • ISBN-13: 9781800208117
  • 相關分類: C++ 程式語言Compiler
  • 相關翻譯: C++ 高性能編程 (簡中版)
  • 立即出貨 (庫存=1)

買這商品的人也買了...

商品描述

Get to grips with various performance improvement techniques such as concurrency, lock-free programming, atomic operations, parallelism, and memory management

 

Key Features:

  • Understand the limitations of modern CPUs and their performance impact
  • Find out how you can avoid writing inefficient code and get the best optimizations from the compiler
  • Learn the tradeoffs and costs of writing high-performance programs

 

Book Description:

The great free lunch of "performance taking care of itself" is over. Until recently, programs got faster by themselves as CPUs were upgraded, but that doesn't happen anymore. The clock frequency of new processors has almost peaked. New architectures provide small improvements to existing programs, but this only helps slightly. Processors do get larger and more powerful, but most of this new power is consumed by the increased number of processing cores and other "extra" computing units. To write efficient software, you now have to know how to program by making good use of the available computing resources, and this book will teach you how to do that.

 

The book covers all the major aspects of writing efficient programs, such as using CPU resources and memory efficiently, avoiding unnecessary computations, measuring performance, and how to put concurrency and multithreading to good use. You'll also learn about compiler optimizations and how to use the programming language (C++) more efficiently. Finally, you'll understand how design decisions impact performance.

 

By the end of this book, you'll not only have enough knowledge of processors and compilers to write efficient programs, but you'll also be able to understand which techniques to use and what to measure while improving performance. At its core, this book is about learning how to learn.

 

What You Will Learn:

  • Discover how to use the hardware computing resources in your programs effectively
  • Understand the relationship between memory order and memory barriers
  • Familiarize yourself with the performance implications of different data structures and organizations
  • Assess the performance impact of concurrent memory accessed and how to minimize it
  • Discover when to use and when not to use lock-free programming techniques
  • Explore different ways to improve the effectiveness of compiler optimizations
  • Design APIs for concurrent data structures and high-performance data structures to avoid inefficiencies

 

Who this book is for:

This book is for experienced developers and programmers who work on performance-critical projects and want to learn different techniques to improve the performance of their code. Programmers who belong to algorithmic trading, gaming, bioinformatics, computational genomics, or computational fluid dynamics communities can learn various techniques from this book and apply them in their domain of work.

 

Although this book uses the C++ language, the concepts demonstrated in the book can be easily transferred or applied to other compiled languages such as C, Java, Rust, Go, and more.

商品描述(中文翻譯)

掌握各種性能改進技術,如並發性、無鎖編程、原子操作、並行性和內存管理。

主要特點:
- 了解現代CPU的限制及其對性能的影響。
- 找出如何避免編寫低效代碼並從編譯器中獲得最佳優化。
- 學習編寫高性能程序的權衡和成本。

書籍描述:
過去的“性能自動提升”時代已經結束。最近,隨著CPU的升級,程序自動變得更快,但這種情況不再發生。新處理器的時鐘頻率幾乎達到了頂峰。新架構對現有程序提供了微小的改進,但這只能稍微幫助。處理器變得更大更強大,但其中大部分新的能力被增加的處理核心和其他“額外”的計算單元所消耗。為了編寫高效的軟件,現在您必須知道如何通過充分利用可用的計算資源來編程,而本書將教您如何做到這一點。

本書涵蓋了編寫高效程序的所有主要方面,如有效使用CPU資源和內存、避免不必要的計算、測量性能以及如何充分利用並發和多線程。您還將了解編譯器優化以及如何更有效地使用編程語言(C++)。最後,您將了解設計決策如何影響性能。

通過閱讀本書,您不僅將獲得足夠的處理器和編譯器知識來編寫高效程序,還將能夠了解在改進性能時使用哪些技術以及該如何進行測量。本書的核心是學習如何學習。

您將學到:
- 發現如何有效地使用硬件計算資源
- 了解內存順序和內存屏障之間的關係
- 熟悉不同數據結構和組織的性能影響
- 評估並發內存訪問的性能影響以及如何最小化它
- 發現何時使用和何時不使用無鎖編程技術
- 探索不同的方法來提高編譯器優化的效果
- 設計用於並發數據結構和高性能數據結構的API,以避免低效率

本書適合有經驗的開發人員和程序員,他們從事性能關鍵項目並希望學習不同的技術來提高代碼性能。屬於算法交易、遊戲、生物信息學、計算基因組學或計算流體力學社區的程序員可以從本書中學習各種技術並應用於他們的工作領域。

儘管本書使用C++語言,但書中演示的概念可以輕鬆轉移到其他編譯語言,如C、Java、Rust、Go等。