Efficient C/C++ Programming (eBook)
438 Seiten
Elsevier Science (Verlag)
978-1-4832-6563-6 (ISBN)
Steve Heller has been a professional programmer for about 25 years, and is the President of Chrysalis Software Corporation, a consulting firm specializing in high-performance software, and practical, down-to-earth instructional materials. He is the author of two excellent books, Efficient C/C++ Programming and Who's Afraid of C++?.
Efficient C/C++ Programming describes a practical, real-world approach to efficient C/C++ programming. Topics covered range from how to save storage using a restricted character set and how to speed up access to records by employing hash coding and caching. A selective mailing list system is used to illustrate rapid access to and rearrangement of information selected by criteria specified at runtime. Comprised of eight chapters, this book begins by discussing factors to consider when deciding whether a program needs optimization. In the next chapter, a supermarket price lookup system is used to illustrate how to save storage by using a restricted character set and how to speed up access to records with the aid of hash coding and caching. Attention is paid to rapid retrieval of prices. A selective mailing list system is then used to illustrate rapid access to and rearrangement of information selected by criteria specified at runtime. The book also considers the Huffman coding and arithmetic coding methods of data compression; a token-threaded interpreter whose code can run faster than equivalent compiled C code, due to its greater code density; a customer database program with variable-length records; and index and key access to variable-length records. The final chapter summarizes the characteristics of the algorithms encountered in previous chapters, as well as the future of the art of optimization. This monograph will be a useful resource for practicing computer programmers and those who intend to be working programmers.
Front Cover 1
Efficient C/C++ Programming 4
Copyright Page 5
Table of Contents 8
Dedication 6
Table of Listings 14
Foreword 18
Preface 20
Acknowledgments 22
CHAPTER 1. Let's Get Small (and Fast): Introduction to Optimization 24
Deciding Whether to Optimize 24
Why Optimization Is Necessary 25
Why Optimization Is Often Neglected 26
Considering a Hardware Solution 26
Categories of Optimization 28
Finding the Critical Resource 28
Determining How Much Optimization Is Needed 29
A Real-Life Example 29
Summary 31
CHAPTER 2. Hash, Cache, and Crunch: A Supermarket Price Lookup System 48
Introduction 48
Up the Down Staircase 48
Some Random Musings 50
Hashing It Out 51
Caching out Our Winnings 56
Heading for The Final Lookup 58
Saving Storage 58
The Code 59
Summary 66
Problems 66
CHAPTER 3. Strips, Bits, And Sorts: A Mailing List System 96
Introduction 96
A First Approach 96
Saving Storage with Bitmaps 98
Increasing Processing Speed 99
Strip Mining 100
Sorting Speed 101
The Code 107
Performance 113
Back to the Future 115
Summary 118
Problems 118
CHAPTER 4. Cn U Rd Ths Qkly?: A Data Compression Utility 146
Introduction 146
Huffman Coding 146
Half a Bit Is Better than One 150
Getting a Bit Excited 151
A Character Study 152
The Code 155
Finding the Bottlenecks 167
Some Assembly Is Required 171
A Bunch of Real Characters 176
1994: A Space Odyssey? 177
Summary 178
Problems 178
CHAPTER 5. Do You Need an Interpreter? 212
Introduction 212
Lost in Translation 213
The Impossible Dream 217
Summary 226
Auxiliary Programs 226
Problems 227
CHAPTER 6. Free at Last: A Customer
234
Introduction 234
A Harmless Fixation 234
The Quantum File Access Method 236
The Itinerary 246
A Logical Analysis 251
Taking It from the Top 266
Summary 268
Problems 268
CHAPTER 7. OO, What an Algorithm: Index and Key Access to
310
Introduction 310
Warning: Overload! 311
An Auto-loader 313
Residence Permit 318
Open Season 323
The Crown of Creation 324
Free the Quantum I6K! 325
One Size Fits All 327
Assembly Instructions Included 330
Heavenly Hash 339
Summary 353
Problems 354
CHAPTER 8. Mozart, No. Would You Believe Gershwin? 426
Introduction 426
Summary of Characteristics 427
Some Thoughts on the Future 428
Goodbye for Now 429
Suggested Approaches to Problems 430
Index 436
| Erscheint lt. Verlag | 10.5.2014 |
|---|---|
| Sprache | englisch |
| Themenwelt | Mathematik / Informatik ► Informatik ► Programmiersprachen / -werkzeuge |
| Mathematik / Informatik ► Informatik ► Theorie / Studium | |
| ISBN-10 | 1-4832-6563-3 / 1483265633 |
| ISBN-13 | 978-1-4832-6563-6 / 9781483265636 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: PDF (Portable Document Format)
Mit einem festen Seitenlayout eignet sich die PDF besonders für Fachbücher mit Spalten, Tabellen und Abbildungen. Eine PDF kann auf fast allen Geräten angezeigt werden, ist aber für kleine Displays (Smartphone, eReader) nur eingeschränkt geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich