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!
Posts Tagged XML
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!
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
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?
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"] against their equivalents in plain
Object instances and typed
class instances. Just how slow are the XML operators? Read on to find out.
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.
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.