Posts Tagged XML

Making describeTypeJSON 50x Faster than describeType

Tags: , , , , , , , , , , ,

The hidden describeTypeJSON function is faster than the XML-based describeType function by default, but we can make it even faster. Today’s article describe just how this is done and achieves a nearly 10x speedup!

Read the rest of this article »

1 Comment

describeType vs. describeTypeJSON

Tags: , , , , , ,

flash.utils.describeType has been around since Flash 9 and is the standard way to find out interesting information about a Class type, including its metadata/annotations. However, there’s a hidden function called describeTypeJSON that provides an interesting alternative. Since describeType is notoriously slow, could describeTypeJSON be the speedy alternative we’ve been looking for? Today’s article puts them to the test!

Read the rest of this article »

7 Comments

When getSize() Lies

Tags: , , , , , , , , , , ,

flash.sampler.getSize() is a handy tool for figuring out how much memory a class instance uses. However, it is often flat-out wrong. Today’s article tries it out on a variety of classes to find out which ones it works on and which ones it doesn’t.

Read the rest of this article »

4 Comments

XMLDocument: The Faster Legacy XML Option

Tags: ,

Sometimes the old, legacy option is faster than the new one you’re supposed to use. That happens to be the case with XML in Flash: XMLDocument is quicker than XML. Today’s article tests its performance to figure out just how much faster it is and if it can keep up with plain Object and typed class instances.

Read the rest of this article »

1 Comment

XML E4X Expression Performance

Tags: ,

If you deal with XML documents, you probably appreciate AS3’s support for the E4X operators. These make it really easy to access the XML class like any old object with the .x (dot) operator as well as XML-specific operators like ..x for descendants and @x for attributes. Even fancier, there’s support for arbitrary expressions like .(@id == "123"). With all this convenience we should wonder- how slow are the E4X expressions?

Read the rest of this article »

1 Comment

XML E4X Operators vs. XML Class Methods

Tags: , , , ,

We know that the XML E4X operators are an 10x slower than plain Object, but how slow are they compared to the XML class’ methods like elements() and attributes? Today’s article finds that out.

Read the rest of this article »

5 Comments

XML Operator Speed

Tags: , , , , , ,

AS3 has always had great support for XML built right into the language, but how fast is it? Today’s article compares the performance of operators that work on XML objects like .@x, .x, ..x, and ["x"] against their equivalents in plain Object instances and typed class instances. Just how slow are the XML operators? Read on to find out.

Read the rest of this article »

4 Comments

The Four Vector Classes

Tags: , , , , , , , ,

There are four Vector classes in AS3. It seems like there is only one—Vector—and that it supports generics, but that is only an illusion. Today’s article will do some tests to reveal the implications to your app’s correctness and efficiency.

Read the rest of this article »

3 Comments

How To Fix the XML Memory “Leak”

Tags: , , , , ,

Dealing with XML files can very easily trigger Flash to “leak” memory. Your app may only keep a tiny fraction of the XML file’s contents, but the whole file may stay in memory and never get garbage collected. Today’s article examines how this happens and how you can clean up all that unused memory.

Read the rest of this article »

20 Comments

Serialize Anything: Part 2

Tags: , , , , , , , , ,

One of the new features in Flash Player 11 is a native JSON encoder/decoder class. In the Serialize Anything article, I neglected to add JSON as an option for serializing and deserializing arbitrary objects. In today’s followup we’ll take a look at the performance of the native JSON class and compare it to ByteArray.readObject/writeObject and XML.

Read the rest of this article »

10 Comments