0%

Book Description

Build fast, scalable, and high performing applications with Delphi

About This Book

  • Build efficient and concurrent applications in Delphi with focused examples
  • Identify performance bottlenecks and apply the correct algorithm to increase the performance of applications.
  • Delve into parallel programming and memory management to optimize your code

Who This Book Is For

This book is for Delphi developers who would like to build high performance applications with Delphi. Prior knowledge of Delphi is assumed.

What You Will Learn

  • Find performance bottlenecks and easily mitigate them
  • Discover different approaches to fix algorithms
  • Understand parallel programming and work with various tools included with Delphi
  • Master the RTL for code optimization
  • Explore memory managers and their implementation
  • Leverage external libraries to write better performing programs

In Detail

Delphi is a cross-platform Integrated Development Environment (IDE) that supports rapid application development for Microsoft Windows, Apple Mac OS X, Google Android, iOS, and now Linux with RAD Studio 10.2. This book will be your guide to build efficient high performance applications with Delphi.

The book begins by explaining how to find performance bottlenecks and apply the correct algorithm to fix them. It will teach you how to improve your algorithms before taking you through parallel programming. You'll then explore various tools to build highly concurrent applications.

After that, you'll delve into improving the performance of your code and master cross-platform RTL improvements. Finally, we'll go through memory management with Delphi and you'll see how to leverage several external libraries to write better performing programs.

By the end of the book, you'll have the knowledge to create high performance applications with Delphi.

Style and approach

This book will take a step-by-step approach with focused examples to teach you how to increase the performance of applications.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Delphi High Performance
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  6. About Performance
    1. What is performance?
      1. Different types of speed
    2. Algorithm complexity
      1. Big O and Delphi data structures
      2. Data structures in practice
      3. Mr. Smith's first program
      4. Looking at code through the Big O eyes
    3. Don't guess, measure!
      1. Profiling with TStopwatch
      2. Profilers
        1. AsmProfiler
        2. Sampling Profiler
        3. AQTime
        4. Nexus Quality Suite
    4. Summary
  7. Fixing the Algorithm
    1. Responsive user interfaces
      1. Updating a progress bar
      2. Bulk updates
      3. Virtual display
    2. Caching
      1. Dynamic cache
    3. Speeding up SlowCode
    4. Summary
  8. Fine-Tuning the Code
    1. Delphi compiler settings
      1. Code inlining control
      2. Optimization
      3. Record field alignment
      4. Assertions
      5. Overflow checking
      6. Range checking
    2. Extracting common expressions
    3. The helpful CPU window
    4. Behind the scenes
      1. A plethora of types
      2. Simple types
      3. Strings
      4. Arrays
      5. Records
      6. Classes
      7. Interfaces
    5. Optimizing method calls
      1. Parameter passing
      2. Method inlining
    6. The magic of pointers
    7. Going the assembler way
    8. Returning to SlowCode
    9. Summary
  9. Memory Management
    1. Optimizing strings and array allocations
    2. Memory management functions
    3. Dynamic record allocation
    4. FastMM internals
    5. Memory allocation in a parallel world
    6. Replacing the default memory manager
      1. ScaleMM
      2. TBBMalloc
    7. Fine-tuning SlowCode
    8. Summary
  10. Getting Started with the Parallel World
    1. Processes and threads
    2. When to parallelize the code?
    3. Most common problems
      1. Never access UI from a background thread
      2. Simultaneous reading and writing
      3. Sharing a variable
    4. Synchronization
      1. Critical sections
      2. Other locking mechanisms
      3. A short note on coding style
      4. Shared data with built-in locking
      5. Interlocked operations
      6. Object life cycle
    5. Communication
      1. Windows messages
      2. Synchronize and Queue
      3. Polling
      4. Performance
    6. Third-party libraries
    7. Summary
  11. Working with Parallel Tools
    1. TThread
      1. Advanced TThread
    2. Setting up a communication channel
      1. Sending messages from a thread
      2. Implementing a timer
    3. Summary
  12. Exploring Parallel Practices
    1. Tasks and patterns
    2. Variable capturing
    3. Tasks
      1. Exceptions in tasks
      2. Parallelizing a loop
      3. Thread pooling
    4. Async/Await
    5. Join
      1. Join/Await
    6. Future
    7. Parallel for
    8. Pipelines
      1. Creating the pipeline
      2. Stages
      3. Displaying the result and shutting down
    9. Summary
  13. Using External Libraries
    1. Using object files
      1. Object file formats
      2. Object file linking in practice
    2. Using C++ libraries
      1. Using a proxy DLL in Delphi
    3. Summary
  14. Best Practices
    1. About performance
    2. Fixing the algorithm
    3. Fine-tuning the code
    4. Memory management
    5. Getting started with the parallel world
    6. Working with parallel tools
    7. Exploring parallel practices
    8. Using external libraries
    9. Final words
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
3.137.217.134