Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Delphi High Performance

You're reading from   Delphi High Performance Master the art of concurrency, parallel programming, and memory management to build fast Delphi apps

Arrow left icon
Product type Paperback
Published in Jun 2023
Publisher Packt
ISBN-13 9781805125877
Length 452 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Primož Gabrijelčič Primož Gabrijelčič
Author Profile Icon Primož Gabrijelčič
Primož Gabrijelčič
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Chapter 1: About Performance 2. Chapter 2: Profiling the Code FREE CHAPTER 3. Chapter 3: Fixing the Algorithm 4. Chapter 4: Don’t Reinvent, Reuse 5. Chapter 5: Fine-Tuning the Code 6. Chapter 6: Memory Management 7. Chapter 7: Getting Started with the Parallel World 8. Chapter 8: Working with Parallel Tools 9. Chapter 9: Exploring Parallel Practices 10. Chapter 10: More Parallel Patterns 11. Chapter 11: Using External Libraries 12. Chapter 12: Best Practices 13. Index 14. Other Books You May Enjoy

Preface

Performance matters!

I started programming on 8-bit micros, and boy, was that an interesting time! Memory was typically not a problem, as we didn’t write big programs, but they certainly weren’t running fast, especially if you run them with a built-in BASIC interpreter. It is not surprising that I quickly learned assembler and spent lots of early years shifting bits and registers around. So did almost everybody else who wanted to release a commercial application written for one of those computers. There were, more or less, no games and applications written in BASIC simply because they would run too slowly and nobody would use them.

Times have changed; computers are now fast — incredibly fast! If you don’t believe me, check the code examples for this book. A lot of times, I had to write loops that spin over many million iterations so that the result of changing the code would be noticed at all. The raw speed of processors has also changed the software development world. Low-level languages such as assembler and C mostly gave way to more abstract approaches — C#, C++, Delphi, F#, Java, Python, Ruby, JavaScript, Go, and so on. The choice is yours. Almost anything you write in these languages runs fast or at least fast enough.

Computers are so fast that we sometimes forget the basic rule — performance matters.

Customers like programs that operate so fast that they don’t have to think about it. If they have to wait 10 seconds for a form to appear after clicking on a button, they won’t be very happy. They’ll probably still use the software, though, provided that it works for them and doesn’t crash. On the other hand, if you write a data processing application that takes 26 hours to do a job that needs to execute daily, you’ll certainly lose them.

I’m not saying that you should switch to assembler. Low-level languages are fast, but coding in them is too slow for modern times, and the probability of introducing bugs is just too high. High-level languages are just fine, but you have to know how to use them. You have to know what is fast and what is not, and ideally, you should take this into account when designing code.

This book will walk you through the different approaches that will help you write better code. Writing fast code is not the same as optimizing a few lines of your program to the max. Most of the time, that is, in fact, the completely wrong approach! However, I’m getting ahead of myself. Let the book speak for itself.

lock icon The rest of the chapter is locked
Next Section arrow right
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime