Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Delphi High Performance
Delphi High Performance

Delphi High Performance: Master the art of concurrency, parallel programming, and memory management to build fast Delphi apps , Second Edition

Arrow left icon
Profile Icon Primož Gabrijelčič
Arrow right icon
Can$12.99 Can$40.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (12 Ratings)
eBook Jun 2023 452 pages 2nd Edition
eBook
Can$12.99 Can$40.99
Paperback
Can$50.99
Subscription
Free Trial
Arrow left icon
Profile Icon Primož Gabrijelčič
Arrow right icon
Can$12.99 Can$40.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (12 Ratings)
eBook Jun 2023 452 pages 2nd Edition
eBook
Can$12.99 Can$40.99
Paperback
Can$50.99
Subscription
Free Trial
eBook
Can$12.99 Can$40.99
Paperback
Can$50.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Delphi High Performance

Profiling the Code

Now that we know what performance is and how to measure it, we can start speeding up our programs. This is, however, not an easy process. For starters, we must know which parts of the program are slowing us down, and that can sometimes be hard to determine.

We can, of course, start by guessing. This will sometimes work, but it will often just result in wasted time and frustration. It turns out that it is usually hard to tell what will be a slow part of a complex program. Even if we start by guessing, it is good if we can then confirm our assumption before we start rewriting the code.

We can do that by adding measurement code, which works great if a program is small or if we know which specific part we want to improve, but most of the time, it is better to use a specialized tool: a profiler.

In this chapter, we’ll look into both approaches, manual profiling and using an automated tool.

We will cover the following topics:

  • Why is it better to measure than to guess?
  • How to manually determine which part of the program is the slowest
  • What tools can we use to find the slow parts of a program?
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Discover external programming libraries that will speed up your programming and code
  • Learn to integrate external libraries into Delphi programs
  • Build fast Delphi applications using concurrency, parallel programming, and memory management

Description

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.

Who is this book for?

This book is for all Delphi programmers. Whether you’re a beginner or an accomplished programmer, you will find something interesting. Even though the focus is on the latest Delphi release, the code uses only standard Delphi syntax without syntactic additions from the latest releases, and most of it should compile and run in any Delphi from XE7 onward. If you’re using an older version of Delphi, don’t despair! Most of the concepts in this book do not depend on a specific Delphi version and will be useful for everyone.

What you will learn

  • Get to grips with algorithmic complexity and learn how to recognize it
  • Use tools to determine program runtime behavior
  • Speed up programs by doing less instead of more
  • Discover the internal workings of Delphi data structures
  • Gain an understanding of Delphi's memory manager
  • Find out how to write low-level parallel programs with TThread
  • Use parallel patterns from the PPL and OTL libraries to write fast code
  • Include external code, written in C or C++, in Delphi programs

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 30, 2023
Length: 452 pages
Edition : 2nd
Language : English
ISBN-13 : 9781805128335
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 30, 2023
Length: 452 pages
Edition : 2nd
Language : English
ISBN-13 : 9781805128335
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 179.97
Expert Delphi
Can$58.99
Delphi High Performance
Can$50.99
Delphi GUI Programming with FireMonkey
Can$69.99
Total Can$ 179.97 Stars icon
Banner background image

Table of Contents

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

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(12 Ratings)
5 star 91.7%
4 star 8.3%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Charles Chambers Jan 19, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great and packed with a lot of good info!
Feefo Verified review Feefo
Tiny Oct 10, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
In all fairness, I haven't worked a lot with Delphi. Most of my work centers deal with platforms. As we bring on more customers, some of the challenges occur in helping those apps run better and they all need better data. This book was perfect in picking and using the right tools and algorithms to do massively parallel processing in finding the right data. I also really liked the emphasis on building observability tools in to make sure one can capture metrics and truly get the best data performance.
Amazon Verified review Amazon
David Izada Rodriguez Jul 05, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Everyone programming with Delphi will need to optimize their programs.Some programs focus on the customer by using a beautiful user interface, showing charts, or delegating tasks to the database.Other programs must solve complex tasks that could make them too slow for practical purposes.This kind of program, limited by the hardware, memory, or size of the problem, can require careful optimization.This book describes program complexity with simple examples.It also shows many ways to improve Delphi code performance.The first step is to discover where your program spends most of its running time. That is profiling. There are several examples of using it on real programs.You can improve performance by using better algorithms.In this book, the author shows how to use one of the best Delphi libraries, Spring4D.Another way to achieve much higher performance is to use parallel programming.Delphi includes the class TThread and several synchronization classes for this kind of scenario.After a detailed analysis, the author extracts some valuable parts of its OmniThreadLibrary to illustrate how to improve what is standard in Delphi.Finally, sometimes it is unnecessary to reinvent the wheel because the solution was already implemented in another language. There is a section about how to link external libraries to Delphi.As the cherry on top, the book finished by describing a good selection of "best practices".This book is the perfect companion for any Delphi developer.All the code used in the book is also in GitHub!Congratulations!
Amazon Verified review Amazon
Swift Expat Aug 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I was asked to be an early reviewer for this book and one of the examples that describes deadlocks was exactly the problem in some parallel code. Primoz gave an introduction and example that filled in the gaps to understand where to look and I solved my problem.I believe every developer would benefit from at least 2 sections of the book but review the table of contents. Some of the sections I will use infrequently so I will choose to skip over the parts that are too complex for me to fully grasp and do not currently apply.The book has very short code snippets, look at the full examples on Github for code that you can actually compile. As stated by the author the book is to focus on a code block, my view is it is something like a course book with homework that you are going to have to review in Delphi. For me it is a good mix of hands-on guided reading and learning.The author writes much like how I imagine a teacher in a classroom to present so there is often a review of what we have learned and what is coming. For me this was a welcome break and a little bit of humor when I imagine him speaking. If you find it annoying, you can simply skip over the 2-3 sentences.I appreciate that @Primož Gabrijelčič took the time to share his knowledge and has updated to a 2nd Edition.
Amazon Verified review Amazon
RODNEY K NICHOLLS Jul 20, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book covers a wide range of topics, from algorithm improvement to tools for finding slow code and parallel programming. It does a great job of explaining complex concepts in a clear and concise way, and the book is full of practical examples that can help you apply the concepts in your own code.The book covers a wide range of topics. Delphi High Performance covers all of the major areas of performance, so you can get a well-rounded understanding of how to write high-performance code.The demo examples that come with the book are comprehensive and clearly demonstrate the points the author is explaining. He doesn't just talk about the concepts in theory, he shows you how to apply them in your own code. This makes the book very valuable for anyone who wants to improve the performance of their Delphi applications.Overall, Delphi High Performance is an excellent book for Delphi developers who want to learn how to write high-performance code. The book is well-written, informative, and full of practical examples. I highly recommend it to anyone who wants to improve the performance of their Delphi applications.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.