Efficient C++: Performance Programming Techniques
暫譯: 高效的 C++:性能編程技術

Dov Bulka, David Mayhew

  • 出版商: Addison Wesley
  • 出版日期: 1999-11-13
  • 售價: $1,710
  • 貴賓價: 9.5$1,625
  • 語言: 英文
  • 頁數: 336
  • 裝訂: Paperback
  • ISBN: 0201379503
  • ISBN-13: 9780201379501
  • 相關分類: C++ 程式語言
  • 已絕版

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

商品描述


Table Of Contents

(Each chapter concludes with Key Points.)
Preface.
Introduction.
Roots of Software Inefficiency.
Our Goal.
Software Efficiency: Does It Matter?
Terminology.
Organization of This Book.
1. The Tracing War Story.

Our Initial Trace Implementation.
What Went Wrong.
The Recovery Plan.

2. Constructors and Destructors.
Inheritance.
Composition.
Lazy Construction.
Redundant Construction.
Key Points.

3. Virtual Functions.
Virtual Function Mechanics.
Templates and Inheritance.
Hard Coding.
Inheritance.
Templates.

4. The Return Value Optimization.
The Mechanics of Return-by-Value.
The Return Value Optimization.
Computational Constructors.

5. Temporaries.
Object Definition.
Type Mismatch.
Pass by Value.
Return by Value.
Eliminate Temporaries with op=().

6. Single-Threaded Memory Pooling.
Version 0: The Global new() and delete().
Version 1: Specialized Rational Memory Manager.
Version 2: Fixed-Size Object Memory Pool.
Version 3: Single-Threaded Variable-Size Memory Manager.

7. Multithreaded Memory Pooling.
Version 4: Implementation.
Version 5: Faster Locking.

8. Inlining Basics.
What Is Inlining?
Method Invocation Costs.
Why Inline?
Inlining Details.
Inlining Virtual Methods.
Performance Gains from Inlining.

9. Inlining—Performance Considerations.
Cross-Call Optimization.
Why Not Inline?
Development and Compile-Time Inlining
Considerations. Profile-Based
Inlining.
Inlining Rules.
Singletons.
Trivials.

10. Inlining Tricks.
Conditional Inlining.
Selective Inlining.
Recursive Inlining.
Inlining with Static Local Variables.
Architectural Caveat: Multiple Register Sets.

11. Standard Template Library.
Asymptotic Complexity.
Insertion.
Deletion.
Traversal.
Find.
Function Objects.
Better than STL?

12. Reference Counting
Implementation Details.
Preexisting Classes.
Concurrent Reference Counting.

13. Coding Optimizations.
Caching.
Precompute.
Reduce Flexibility.
80-20 Rule: Speed Up the Common Path.
Lazy Evaluation.
Useless Computations.
System Architecture.
Memory Management.
Library and System Calls.
Compiler Optimization.

14. Design Optimizations.
Design Flexibility.
Caching.
Web Server Timestamps.
Data Expansion.
The Common Code Trap.
Efficient Data Structures.
Lazy Evaluation.
getpeername().
Useless Computations.
Obsolete Code.

15. Scalability.
The SMP Architecture.
Amdahl's Law.
Multithreaded and Synchronization Terminology.
Break Up a Task into Multiple Subtasks.
Cache Shared Data.
Share Nothing.
Partial Sharing.
Lock Granularity.
False Sharing.
Thundering Herd.
Reader/Writer Locks.

16. System Architecture Dependencies
Memory Hierarchies.
Registers: Kings of Memory.
Disk and Memory Structures.
Cache Effects.
Cache Thrash.
Avoid Branching.
Prefer Simple Calculations to Small Branches.
Threading Effects.
Context Switching.
Kernel Crossing.
Threading Choices.

Bibliography.
Index. 0201379503T04062001


Back to Top

商品描述(中文翻譯)

目錄

(每章結尾都有重點摘要。)

前言。
導言。
軟體效率的根源。
我們的目標。
軟體效率:重要嗎?
術語。
本書的組織結構。
1. 追蹤戰爭故事。
我們的初始追蹤實作。
出了什麼問題。
復原計畫。

2. 建構子與解構子。
繼承。
組合。
延遲建構。
冗餘建構。
重點摘要。

3. 虛擬函數。
虛擬函數的機制。
模板與繼承。
硬編碼。
繼承。
模板。

4. 回傳值優化。
以值回傳的機制。
回傳值優化。
計算建構子。

5. 暫時物件。
物件定義。
類型不匹配。
以值傳遞。
以值回傳。
使用 op=() 消除暫時物件。

6. 單執行緒記憶體池。
版本 0:全域 new() 和 delete()。
版本 1:專用的有理記憶體管理器。
版本 2:固定大小物件記憶體池。
版本 3:單執行緒可變大小記憶體管理器。

7. 多執行緒記憶體池。
版本 4:實作。
版本 5:更快的鎖定。

8. 內聯基礎。
什麼是內聯?
方法調用成本。
為什麼要內聯?
內聯細節。
內聯虛擬方法。
內聯帶來的性能提升。

9. 內聯—性能考量。
跨調用優化。
為什麼不內聯?
開發與編譯時內聯考量。
基於分析的內聯。
內聯規則。
單例模式。
微不足道的情況。

10. 內聯技巧。
條件內聯。
選擇性內聯。
遞迴內聯。
使用靜態局部變數的內聯。
架構警告:多個暫存器集。

11. 標準模板庫。
漸進複雜度。
插入。
刪除。
遍歷。
查找。
函數物件。
比 STL 更好嗎?

12. 參考計數。
實作細節。
先前存在的類別。
並行參考計數。

13. 編碼優化。
快取。
預計算。
減少靈活性。
80-20 規則:加速常見路徑。
延遲評估。
無用計算。
系統架構。
記憶體管理。
函式庫與系統調用。
編譯器優化。

14. 設計優化。
設計靈活性。
快取。
網頁伺服器時間戳。
數據擴展。
常見代碼陷阱。
高效數據結構。
延遲評估。
getpeername()。
無用計算。
過時代碼。

15. 可擴展性。
SMP 架構。
阿姆達爾法則。
多執行緒與同步術語。
將任務拆分為多個子任務。
快取共享數據。
完全不共享。
部分共享。
鎖粒度。
假共享。
雷霆群。
讀者/寫者鎖。

16. 系統架構依賴性。
記憶體層次結構。
暫存器:記憶體之王。
磁碟與記憶體結構。
快取效應。
快取抖動。
避免分支。
偏好簡單計算而非小分支。
執行緒效應。
上下文切換。
核心交互。
執行緒選擇。

參考文獻。
索引。 0201379503T04062001