Archive for category AS3

Operator Speed

Tags: ,

Today’s article is about the basic operators that make up most languages, and in particular AS3. Without them there wouldn’t be much of a language. So it would seem vitally important that we know how they perform relative to each other. Is shifting faster than adding? Adding faster than multiplying? Multiplying faster than dividing? Does the type of the operands matter? Read on for the results in high detail. Update: see my comment below for an important change to the results.

Read the rest of this article »

15 Comments

Cast Speed

Tags: , , , ,

One of the first articles I wrote for this site covered the two types of casts available to the AS3 programmer. In that article I covered the syntax of the two as well as some of the quirks. Today I’ll cover the performance differences between them.

Read the rest of this article »

32 Comments

Simple Plugin System

Tags: , ,

Sizable applications are often in need of externalizing code from the main application. Often times this is done via a library or framework and it is well understood in the Flash community how to use these in our applications. What is less-understood is how we can go about delegating some parts of our applications to plugins. Read on for a simple technique to get plugins into your Flash application.

Read the rest of this article »

16 Comments

Even Faster isNaN()

Tags: , , , ,

I wrote an article last November showing how to make your isNaN() calls 12x faster. Today, thanks to a tip from the comments on that article, I’ll show you how to make your isNaN() calls even even faster! (UPDATE: see the definitive article on isNaN for much more!)

Read the rest of this article »

9 Comments

Logical Operator Performance

Tags: , ,

An absolute fundamental of programming is the concept of logical operators like && and ||. In a recent comment, Chris H pointed out that MXMLC doesn’t do a particularly good job generating bytecode for these operators. Today I’ll look further into the subject and see just how much this impacts performance.

Read the rest of this article »

10 Comments

Object Creation: Part II

Tags: , , , ,

As a followup to the previous article about object creation and a comment about an alternate object creation strategy, today’s article will expand the coverage of object creation. I will also discuss the performance (and generated bytecode) for creating non-empty objects to see if there are any redeeming factors to the “curly braces” (o = {}) approach.

Read the rest of this article »

7 Comments

Object Creation

Tags: , , , ,

A comment posted before the Flash Player 10.1 series of articles asked about the performance differences between creating an object with o = new Object() and with o = {}. Below I’ll look into the generated bytecode for these two approaches and test their relative performance to see if either approach is faster than the other.

Read the rest of this article »

19 Comments

Conditionals Performance

Tags: , , , , , ,

Now that the Flash Player 10.1 testing is through I can return to a comment asking about the performance difference between if-else chains and the ternary (? :) operator. Further, I’ll discuss switch statements to see if there is any difference in performance for these commonly-used methods of flow control.

Read the rest of this article »

7 Comments

Flash Player 10.1 Performance: Part 6

Tags:

Today’s article is the conclusion of my series on Flash Player 10.0 versus Flash Player 10.1 performance. If you haven’t yet read the first, second, third, fourth, and fifth articles, that’s a good place to start. If you have, read on for the finale!

Read the rest of this article »

12 Comments

Flash Player 10.1 Performance: Part 5

Tags:

Part five of this series on Flash Player 10.0 versus Flash Player 10.1 performance continues re-testing performance articles just like the first, second, third, and fourth articles did. Read on for more performance comparisons!

Read the rest of this article »

No Comments