Posts Tagged fields

Local Variable Caching

Recently, I’ve seen a lot of performance-critical code that has made heavy use of field variables. For example, an expensive loop might look like this: for (var i:int = 0; i < this.numObjects; ++i). I've recommended to some of the programmers writing such code that they modify it to cache the field variable as a local variable to improve performance. Was I right to recommend this? In today's article I'll examine the read and write times to see if caching field variables locally really improves performance.

Read the rest of this entry »

Tags: , , ,

9 Comments

Function Length

In my last article on getProperties, there was one strange finding in the tests of standard classes: the Function class seems to have a length field. What is it? Today we’ll see

Read the rest of this entry »

Tags: , , , , , , ,

4 Comments

Class Bootup

Being allowed to declare and define member variables all at once introduces a question: in which order does the class boot up? Further, if the class has parent classes, how does this change things? Read on for the simple results.

Read the rest of this entry »

Tags: , ,

2 Comments

Overriding Variables

AS3 makes some strange things possible. Even stranger, it seems to do this without any warning by its compiler: MXMLC. It seems as though one of these strange things is the ability to override the variables of your parent classes.

Read the rest of this entry »

Tags: , ,

3 Comments