1. Technology

Before you start optimizing Delphi code

"Any program will expand to fill available memory..."


Sooner or later you'll find out that Murphy has it. The idea behind this article is to help you ease the process of optimizing and debugging your Delphi applications.

Note: why not start with the Speed and Size: Top 10 Tricks article.

  • The High Performance Delphi site has detailed optimization information for the intermediate to advanced Delphi programmer with some working knowledge of general optimization techniques. The Fundamentals section examplains the purpose of code optimization proccess. The bulk of the information presented in these pages concerns optimization from the algorithm level down. The selection or development of the algorithm is not covered. What is covered, is some general considerations about choosing algorithms, and how to adapt and implement those algorithms so that they perform optimally. Delphi Optimization Guidelines section are divided into functional groups: General Guidelines, Integer Guidelines, String Guidelines and Floating Point Guidelines. General guidelines are designed to help you understand why is it better to use local variables instead of global, why you should not use nested routines, what is the difference between linked lists and arrays and how to opti mize Delphi for loops. Integer Guidelines relate to any ordinal type, including characters. Topics like subrange types and integer multiplication are discussed here. String guidelines relate to string and PChar issues. Floating point optimization guidelines are about extended type, mixing real types, function vs procedure and similiar.

  • Non-obvious Debugging Techniques - we all have to debug applications, and there are many common techniques available to help things along. This session reveals a number of techniques that can be useful to aid the debugging task, but which are not of a particularly obvious nature.

  • In the Delphi Efficiency Optimisation article, the author explores numerous tools and techniques that are available when working on Delphi efficiency and performance optimization. You'll see a structured performance optimization process, how to (top-down) break down the application and optimise step by step. We're also see special bottom-up optimisation, a feature introduced by the re-usable Component nature of Delphi.

  • Extreme Programming. Extreme Programming (XP) is a deliberate and disciplined approach to software development. This methodology emphasizes team work. Managers, customers, and developers are all part of a team dedicated to delivering quality software. The idea behind XP is that "as you write each bit of code, you should also write a little test to go with it". Tests are automated and provide a safety net for programmers and customers alike. Tests are created before the code is written, while the code is written, and after the code is written. The DUnit is an Xtreme testing framework for Delphi programs. The "Testing the World Away" describes the use of Dunit.

    Before you jump on the bandwagon and start optimizing every line of code, keep in mind that a good application design and architechture can do more for performance than even the most finely tuned code. The Delphi Coding Standards and Conventions will show you how to apply solid design principles and coding practices. The articles present recommendations of standards and conventions for designing, coding, and commenting software projects written in Delphi.

  • ©2014 About.com. All rights reserved.