The Art of Writing Efficient Programs: An advanced programmer's guide to efficient hardware utilization and compiler optimizations using C++ examples (Paperback)
暫譯: 高效程式設計的藝術:進階程式設計師的高效硬體利用與編譯器優化指南(以 C++ 範例為主)

Pikus, Fedor G.

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

相關主題

商品描述

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 等。