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.
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
One essential to a
Stage3D app is the ability to manipulate models in the 3D scene. Today’s article presents a class for making this really easy by avoiding all the manual work you’d to to save translation, rotation, and scale values as fields and manipulate various
Matrix3D instances. Read on for the source code and a demo app.
Programming in AS3 invariably involves choosing between various collections:
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!
String.charCodeAt is a simple function so you might expect the function call overhead (huge in AS3) to making calling it frequently quite slow. You’d think that there’s no way an
charCodeAt-using AS3 function could beat a built-in
String function like
indexOf. Would you be right? Today’s article examines this special function to see if we might defy conventional wisdom and achieve a performance boost.
If-else trees have some of the best performance of any conditional code, including
if-else ladders, the ternary (
? :) operator, and the
switch statement. But how do they stack up against the O(1) lookups that
Dictionary offer us AS3 programmers? Today’s article finds out!
Surprisingly, some interesting things have been happening with conditionals like
if-else in AS3. First, a brand new AS3 compiler—ASC 2.0—has been released with the promise that it’ll generate more efficient bytecode. Second, some readers have pointed out the existence of a new (to me) technique: the “if-else tree”. Today’s article takes a look at just what that is and tests it against the classic options:
if-else, the ternary (
? :) operator, and the
switch statement. Which will be fastest?