Efficient C++: Performance Programming Techniques

Dov Bulka, David Mayhew

  • 出版商: Addison Wesley
  • 出版日期: 1999-11-13
  • 售價: $1,670
  • 貴賓價: 9.5$1,587
  • 語言: 英文
  • 頁數: 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