TIENE EN SU CESTA DE LA COMPRA
en total 0,00 €
In today's fast and competitive world, a program's performance is just as important to customers as the features it provides. This practical guide teaches developers performance-tuning principles that enable optimization in C++. You'll learn how to make code that already embodies best practices of C++ design run faster and consume fewer resources on any computer-whether it's a watch, phone, workstation, supercomputer, or globe-spanning network of servers.
Author Kurt Guntheroth provides several running examples that demonstrate how to apply these principles incrementally to improve existing code so it meets customer requirements for responsiveness and throughput. The advice in this book will prove itself the first time you hear a colleague exclaim, "Wow, that was fast. Who fixed something?ö
Locate performance hot spots using the profiler and software timers
Learn to perform repeatable experiments to measure performance of code changes
Optimize use of dynamically allocated variables
Improve performance of hot loops and functions
Speed up string handling functions
Recognize efficient algorithms and optimization patterns
Learn the strengths-and weaknesses-of C++ container classes
View searching and sorting through an optimizer's eye
Make efficient use of C++ streaming I/O functions
Use C++ thread-based concurrency features effectively
Chapter 1An Overview of Optimization
Optimization Is Part of Software Development
Optimization Is Effective
It's OK to Optimize
A Nanosecond Here, a Nanosecond There
Summary of Strategies for Optimizing C++ Code
Summary
Chapter 2Computer Behavior Affecting Optimization
Lies C++ Believes About Computers
The Truth About Computers
C++ Tells Lies Too
Summary
Chapter 3Measure Performance
The Optimizing Mindset
Perform Experiments
Profile Program Execution
Time Long-Running Code
Estimate Code Cost to Find Hot Code
Other Ways to Find Hot Spots
Summary
Chapter 4Optimize String Use: A Case Study
Why Strings Are a Problem
First Attempt at Optimizing Strings
Second Attempt at Optimizing Strings
Eliminate String Conversion
Summary
Chapter 5Optimize Algorithms
Time Cost of Algorithms
Toolkit to Optimize Searching and Sorting
Efficient Search Algorithms
Efficient Sort Algorithms
Optimization Patterns
Summary
Chapter 6Optimize Dynamically Allocated Variables
C++ Variables Refresher
C++ Dynamic Variable API Refresher
Reduce Use of Dynamic Variables
Reduce Reallocation of Dynamic Variables
Eliminate Unneeded Copying
Implement Move Semantics
Flatten Data Structures
Summary
Chapter 7Optimize Hot Statements
Remove Code from Loops
Remove Code from Functions
Optimize Expressions
Optimize Control Flow Idioms
Summary
Chapter 8Use Better Libraries
Optimize Standard Library Use
Optimize Existing Libraries
Design Optimized Libraries
Summary
Chapter 9Optimize Searching and Sorting
Key/Value Tables Using std::map and std::string
Toolkit to Improve Search Performance
Optimize Search Using std::map
Optimize Search Using the
Optimize Search in Hashed Key/Value Tables
Stepanov's Abstraction Penalty
Optimize Sorting with the C++ Standard Library
Summary
Chapter 10Optimize Data Structures
Get to Know the Standard Library Containers
std::vector and std::string
std::deque
std::list
std::forward_list
std::map and std::multimap
std::set and std::multiset
std::unordered_map and std::unordered_multimap
Other Data Structures
Summary
Chapter 11Optimize I/O
A Recipe for Reading Files
Writing Files
Reading from std::cin and Writing to std::cout
Summary
Chapter 12Optimize Concurrency
Concurrency Refresher
C++ Concurrency Facilities Refresher
Optimize Threaded C++ Programs
Make Synchronization More Efficient
Concurrency Libraries
Summary
Chapter 13Optimize Memory Management
C++ Memory Management API Refresher
High-Performance Memory Managers
Provide Class-Specific Memory Managers
Provide Custom Standard Library Allocators
Summary