Book Image

Delphi High Performance - Second Edition

By : Primož Gabrijelčič
5 (1)
Book Image

Delphi High Performance - Second Edition

5 (1)
By: Primož Gabrijelčič

Overview of this book

Performance matters! Users hate to use programs that are not responsive to interactions or run too slow to be useful. While becoming a programmer is simple enough, you require dedication and hard work to achieve an advanced level of programming proficiency where you know how to write fast code. This book begins by helping you explore algorithms and algorithmic complexity and continues by describing tools that can help you find slow parts of your code. Subsequent chapters will provide you with practical ideas about optimizing code by doing less work or doing it in a smarter way. The book also teaches you how to use optimized data structures from the Spring4D library, along with exploring data structures that are not part of the standard Delphi runtime library. The second part of the book talks about parallel programming. You’ll learn about the problems that only occur in multithreaded code and explore various approaches to fixing them effectively. The concluding chapters provide instructions on writing parallel code in different ways – by using basic threading support or focusing on advanced concepts such as tasks and parallel patterns. By the end of this book, you’ll have learned to look at your programs from a totally different perspective and will be equipped to effortlessly make your code faster than it is now.
Table of Contents (15 chapters)

Don’t Reinvent, Reuse

After dedicating one chapter to a discussion on how to fix an algorithm, it is now time to … do it again! Truth be told, we merely scraped the surface in the previous chapter. You could write an entire book about improving algorithms but I don’t have that much space dedicated to the topic, so you will have to be satisfied with one (more) chapter.

In the previous chapter, we looked at some examples of improving speed by doing less work. This time, we’ll take a different approach and run better, more optimized code. We will, however, not optimize our code – as that is a job for the next chapter – but take the smarter way and use a well-written external library. It will not only be better than our code but will also perform better than Delphi’s Run-Time Library (RTL).

There is, of course, no silver bullet and we cannot expect that one external library will solve all our problems and help us write programs twice...