1 option
Delphi high performance : master the art of concurrency, parallel programming, and memory management to build fast Delphi apps / Primoz Gabrijelcic.
- Format:
- Book
- Author/Creator:
- Gabrijelčič, Primož, author.
- Language:
- English
- Subjects (All):
- Delphi (Computer file).
- Computer software--Development.
- Computer software.
- Physical Description:
- 1 online resource (452 pages)
- Edition:
- Second edition.
- Place of Publication:
- Birmingham, England : Packt Publishing Ltd., [2023]
- Summary:
- 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.
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Contributors
- Table of Contents
- Preface
- Chapter 1: About Performance
- Technical requirements
- What is performance?
- Different types of speed
- Algorithm complexity
- Big O and Delphi data structures
- Data structures in practice
- Mr. Smith's first program
- Looking at code through Big O eyes
- Summary
- Chapter 2: Profiling the Code
- Don't guess, measure!
- Profiling with TStopwatch
- Profilers
- Chapter .3: Fixing the Algorithm
- Writing responsive user interfaces
- Updating a progress bar
- Bulk updates
- Virtual display
- Caching
- Memoization
- Dynamic cache
- Speeding up SlowCode
- Chapter 4: Don't Reinvent, Reuse
- Spring for Delphi
- Enumerations, collections, and lists
- IEnumerable<
- T>
- ICollection<
- IList<
- Other interfaces
- TEnumerable
- Stacks and queues
- Trees
- Red-black trees
- Sets and dictionaries
- ISet<
- IMultiSet<
- IDictionary<
- TKey, TValue>
- IBiDiDictionary<
- Chapter 5: Fine-Tuning the Code
- Delphi compiler settings
- Code inlining control
- Optimization
- Record field alignment
- Assertions
- Overflow checking
- Range checking
- Extracting common expressions
- The helpful CPU window
- Behind the scenes
- A plethora of types
- Simple types
- Strings
- Arrays
- Records
- Classes
- Interfaces
- Optimizing method calls
- Parameter passing
- Method inlining
- The magic of pointers
- Going the assembler way
- Returning to SlowCode
- Chapter 6: Memory Management
- Optimizing strings and array allocations.
- Memory management functions
- Dynamic record allocation
- FastMM4 internals
- Memory allocation in a parallel world
- Replacing the default memory manager
- Logging memory manager
- FastMM4 with release stack
- FastMM5
- TBBMalloc
- Comparing memory managers
- There is no silver bullet
- Fine-tuning SlowCode
- Chapter 7: Getting Started with the Parallel World
- Processes and threads
- Multithreading
- Multitasking
- When to parallelize code
- The most common problems
- Never access the UI from a background thread
- Simultaneous reading and writing
- Sharing a variable
- Hidden behavior
- Synchronization
- Critical sections
- Other locking mechanisms
- A short note on coding style
- Shared data with built-in locking
- Interlocked operations
- Object life cycle
- Communication
- Windows messages
- Synchronize and Queue
- Polling
- Performance
- Third-party libraries
- Chapter 8: Working with Parallel Tools
- TThread
- Automatic life cycle management
- Advanced TThread
- Setting up a communication channel
- Sending messages from a thread
- Using TCommThread
- Implementing a timer
- Synchronizing with multiple workers
- WaitForMultipleObjects
- Condition variables
- Comparing both approaches
- Chapter 9: Exploring Parallel Practices
- Tasks and patterns
- Variable capturing
- Tasks
- Exceptions in tasks
- Parallelizing a loop
- Thread pooling
- Async/Await
- Join
- Join/Await
- Future
- Parallel for
- Pipelines
- Web spider
- The filter stage
- The downloader stage
- The parser stage
- Chapter 10: More Parallel Patterns
- Using OmniThreadLibrary
- Blocking collections
- Using blocking collections with TThread-based threads
- Async/Await.
- Join
- Parallel Task
- Background Worker
- Initial query
- Pipeline
- Creating the pipeline
- Stages
- Displaying the result and shutting down
- Map
- Timed Task
- Chapter 11: Using External Libraries
- Linking with object files
- Object file formats
- Object file linking in practice
- Using C++ libraries
- Writing exported functions
- Using a proxy DLL in Delphi
- Chapter 12: Best Practices
- About performance
- Profiling the code
- Fixing the algorithm
- Don't reinvent, reuse
- Fine-tuning the code
- Memory management
- Getting started with the parallel world
- Working with parallel tools
- Exploring parallel practices
- More parallel patterns
- Using external libraries
- Final words
- Index
- Other Books You May Enjoy.
- Notes:
- Includes index.
- Description based on print version record.
- ISBN:
- 9781805128335
- 1805128337
- OCLC:
- 1390065203
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.