Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 4.1

COLUMN

Optimizing REALbasic

Tips & Tricks for Performance Optimizations

Issue: 4.1 (September/October 2005)
Author: Hank Marquis
Author Bio: Hank Marquis is the creator of Extreme Optimizing (http://www.extremeoptimizing.com) and CTO of SlayFire Software Co., creating performance, quality, and porting tools for REALbasic (http://www.slayfire.com). He is the author of code optimization tools for Visual Basic and the author of VB6 Programmers Toolkit and the VB6 Bible.
Article Description: No description available.
Article Length (in bytes): 11,187
Starting Page Number: 44
Article Number: 4121
Related Web Link(s):

http://www.extremeoptimizing.com
http://www.slayfire.com
http://www.slayfire.com/OptimizerScience/speedtest7.html

Excerpt of article text...

This new column covers REALbasic (RB) performance optimization strategies to help you optimize the speed, resource requirements, and usability of your REALbasic applications. Each column shows you some tips, tricks, and techniques to speed up your Mac, Windows, and Linux applications.

Choosing the correct combination of keywords and syntax is optimization, and as a developer you only really have control over the code you write. Other factors such as network or disk are also common factors in REALbasic application performance. Most REALbasic applications are slowed by the actual processing speed of the code you have written. Even so, you can often find many points in your application where the speed of your code is the controlling factor, especially for routines that are called frequently or in loops. There are no less than eight ways to program a loop in Basic (Goto, Do...Loop, Do While...Loop, Do Until...Loop, Do...Loop While, Do...Loop Until, While...Wend and For...Next). Which one is fastest? The answer? It depends!

How about Select Case? Using a string as the compare item is much slower than using the Asc() value. The same with testing for greater than, less than, or equality as well. Only one works best for a given situation, and if you apply yourself, and apply sound programming skills, the result using REALbasic equals or betters the result using another language. The important thing to understand is that the assumption that REALbasic must be less efficient, larger, or slower than some other language is dead wrong.

While a list of common optimizations is handy, I am going to introduce you to a method for writing and maintaining code that includes optimization as part of the normal development process: Extreme Optimization (XO.)

Extreme Optimization

XO consists of approaching optimization using a number of easy steps any RB developer can take to improve the performance of any application. XO derives from opportunistic optimization -- finding and fixing the 20% of your code responsible for the 80% of performance problems. XO says:

...End of Excerpt. Please purchase the magazine to read the full article.