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 18 in printed book and digital formats -- plus a one-year subscription (beginning with 19.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 3.4

REVIEW

SlayFire Reality

Issue: 3.4 (March/April 2005)
Author: Toby Rush
Article Description: No description available.
Article Length (in bytes): 4,362
Starting Page Number: 10
Article Number: 3407
Related Web Link(s):

http://slayfire.com/

Full text of article...

REAL Software acted on customer requests several years ago by adding the capability to export (and re-import) REALbasic projects as XML files. There were several reasons for this feature, the most prominent being that XML files could be manipulated by third-party programs to improve and extend the REALbasic IDE... without REAL Software needing to publish their proprietary file format.

One of the most recent programs to take advantage of this capability is the SlayFire Reality Suite, a set of programs aimed at assisting programmers improve the efficiency of their code. The cause is a noble one; by using SlayFire Reality, programmers can learn useful tips that apply very specifically to their own coding style.

The SlayFire Suite manages this feat by working with an XML-formatted project file and adding code to it (which brings up the importance of working on a copy of the project file). Adding the extra code takes little time (a 70,000 line project takes less than a minute). Once the augmentation is complete, the project should be re-compiled using the REALbasic IDE, and the compiled app should be run and put through its ordinary paces.

The extra SlayFire code causes a log file to be written, which is to be opened in SlayFire Optimizer. After parsing the log file (which, again, goes very quickly), Optimizer presents you with a complete list of methods in the project, sorted by the percentage of total processing time they took to run. (The intent for this is that the slowest methods are the most inefficient and require optimization more urgently.) The top few offenders are also shown in a bar chart so they can be compared graphically.

Clicking a method in the list takes you to a code listing for that method. Optimizer highlights lines it thinks could be improved, and clicking on one of these lines brings up a list of short optimization topics that apply to the line. Clicking on one of these topics opens a page in your web browser describing the optimization in detail. The page shows before/after example code, shows average speed improvement, and indicates the relative risk of causing problems by making the change. Optimizer includes 83 of these tidbits, ranging from "Use For-Each instead of For to iterate through arrays" to "Where possible, use RGB() instead of CMY()."

Optimizer's advice is not always applicable; because the program operates on each line independently, there are situations where it will offer improvements that do not apply. On the whole, however, the suggestions are helpful, even in the few cases where they don't pertain to the code at hand. (Clicking on the "Settings" button allows you to peruse all 83 suggestions.)

The other two programs in the SlayFire Suite are Interceptor, which creates a method-by-method trace of your program's execution (so you can spot peculiarities in the execution path, which can help you detect hard-to-find bugs); and Analyzer, which helps you create SlayFire log files that cover the maximum percentage of your code.

While a little difficult to use at first, the SlayFire Suite can be an invaluable resource to any REALbasic user -- by creating more efficient programs and more capable programmers.

End of article.