Posts Tagged bytearray

ByteArray Secrets

Tags: , , , ,

The ByteArray class is not as straightforward as you might think. In certain situations, it has surprising, undocumented functionality. Today’s article goes into some of these strange behaviors so you’ll get a better handle on exactly what’s going on behind the scenes.

Read the rest of this article »

6 Comments

ActionScript Workers: Changing ByteArray Length

Tags: , ,

In the last article we learned that a ByteArray shared between two workers also shares its length field but not its position field. This raises a followup question: what about when the length changes? Today’s article sees what happens when you change the length of a ByteArray that is shared between two ActionScript workers to see just how shared that length field really is.

Read the rest of this article »

No Comments

ActionScript Workers: Sharing ByteArrays

Tags: , ,

ActionScript workers allow you to take advantage of today’s multi-core processors by creating multiple threads of execution. These threads will invariably need to share some data between them. By default, all data passed between the workers/threads is copied, which can be really slow. The ByteArray class can be shared without copying. Today’s article discusses this and talks about some quirks that come along with it.

Read the rest of this article »

9 Comments

Reduce AMF Bloat With AMFObjectPooler

Tags: , , , ,

AMF is great for serializing AS3 objects. Its compact binary format is far more efficient than XML or JSON and it’s just as easy to use: just call writeObject or readObject. However, there are many ways to make it even more efficient. Today’s article presents one more way that eliminates some overhead you might not have thought out. Read on to learn more and for a helper class that will enable you to avoid it.

Read the rest of this article »

2 Comments

How To Shrink Field Names in AMF Data

Tags: , , , , , ,

To save precious bandwidth, keeping your AMF data size small is crucial. By default, AMF has a tendency to create bloated data sizes. In the last article, I showed a way to shrink your class names to a single character when stored in AMF data. Today I’ll show a you a trick to shrink your class field names to a single character. Read on to find out how.

Read the rest of this article »

2 Comments

How To Minimize AMF Serialization Size

Tags: , , ,

I’ve talked about AMF serialization size before, but there’s one tip I left out. Today’s article shows you one crucial step you need to take to make sure your AMF data is packed as tightly as possible so you’re not wasting file size or bandwidth.

Read the rest of this article »

4 Comments

AMF Serialization Tricks

Tags: , , ,

AMF is great in its stock configuration, but there are some little-known tricks to make it even better. Today’s article shows you how to customize the serialization and deserialization of objects to achieve even smaller file sizes and gain maximum control.

Read the rest of this article »

7 Comments

Why Objects Serialized With ByteArray Are So Small

Tags: , , , , , ,

We know that you can automatically serialize anything to a ByteArray and that it’s faster and smaller than XML or JSON, but why is it so much smaller? Today’s article investigates a bit and reveals the secret that makes it such an efficient format and how that can save you a lot of manual work when it comes time to deserialize the ByteArray.

Read the rest of this article »

6 Comments

450x Speed Up Copying Between Collections

Tags: , , , , ,

Programming in AS3 invariably involves choosing between various collections: Array, Vector, Dictionary, Object, ByteArray, and so on. What if you need to quickly copy between them? Your choice of collection could result in a 450x slowdown in your app… or a 450x speedup!

Read the rest of this article »

7 Comments

Loop Speed Redux

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

AS3 has three kinds of loops—for, for-in, and for-each—but which is fastest? I attempted to answer that question about three years ago, but the article is in dire need of a followup as many version of Flash Player have been released since then and the question is core to our everyday lives as AS3 programmers. So which type of loop is fastest in 2012?

Read the rest of this article »

15 Comments