Posts Tagged performance

ByteArray Secrets

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 entry »

Tags: , , , ,

2 Comments

Optimize Algorithms and Data Structures First

Today’s article is both a reminder to optimize your algorithms and data structures before your code and a demonstration of the payoff you’ll get by doing so. By choosing the most effective algorithm and data structure to solve your problem you’ll reap huge rewards in performance. A 10x, 100x, or even bigger boost is easily attainable.

Read the rest of this entry »

Tags: , , , ,

No Comments

Recursion vs. Iteration

Function calls in Flash are notoriously slow. Recursive algorithms require lots of function calls by definition. So are iterative versions faster? Today’s article explores whether or not it’s worth converting your recursive algorithm into an iterative one.

Read the rest of this entry »

Tags: , , ,

9 Comments

Int Keys: Object vs. Dictionary vs. Array vs. Vector

Given that Object and Dictionary can have int keys and that int keys are faster than String keys, a natural performance test follows: which class is fastest at reading from and writing to those int keys? Is there a difference between the four Vector classes? Today’s article performs just that test and comes up with the answers.

Read the rest of this entry »

Tags: , , , , , , , ,

6 Comments

String Keys vs. Int Keys

Now that we know you can use int keys with Object, it’s time to test whether or not this is any faster than String keys. Today’s article does just that and also tests int and String keys with Dictionary.

Read the rest of this entry »

Tags: , , , , , ,

3 Comments

AS3 vs. JavaScript Performance Followup (November 2013)

It’s been about seven months since my last test of AS3 versus JavaScript and there have been several major releases of both browsers and the Flash Player. Today, we pit every major browser against each other and Flash Player itself to get an updated picture of which provides the fastest scripting environment on the web.

Read the rest of this entry »

Tags: ,

9 Comments

ActionScript Worker Message Passing is Slow

Since Flash Player 11.4 was released we have finally been given the ability to run multiple threads of AS3 code to take advantage of modern multi-core CPUs. However, when we start writing this multi-threaded code we immediately run into the requirement to coordinate the threads by passing messages between them. As it turns out, this is quite slow in AS3. Read on for the performance analysis.

Read the rest of this entry »

Tags: , ,

6 Comments

Introducing Timely: A Sub-Millisecond Timer

Whether you’re using Adobe Scout or good old getTimer, there is a fundamental limitation: all times are in whole milliseconds. This is an issue if you’re trying to measure code that executes very quickly or compare code that has only minor differences. In these cases you get inconsistent results (7ms, 8ms, 7ms, 7ms, 8ms, …) when you’d much rather have better accuracy (7.3ms) with sub-millisecond precision. Today’s article introduces a new helper class called Timely that makes sub-millisecond precision a snap. Read on for the source code and an example app.

Read the rest of this entry »

Tags: , ,

4 Comments

Domain Memory Opcode Performance: Reading and Writing

In last week’s primer on the new domain memory (“Alchemy”) opcodes the initial test showed that they couldn’t match the performance of good old Vector when writing out a lot of float/Number values. Today’s article expands on that test to check the performance of writing integers and the performance of reading integers and float/Number values. Can the domain memory opcodes redeem themselves? Read on to find out.

Read the rest of this entry »

Tags: , , , ,

8 Comments

An ASC 2.0 Domain Memory Opcodes Primer

Since January, Adobe has dropped the “premium features” requirement for Flash apps that use the “domain memory opcodes” (a.k.a. “Alchemy opcodes”) that provide low-level performance-boosting operations that let you deal more-or-less directly with blocks of memory. Then in February we got Flash Player 11.6 along with built-in ASC 2.0 support for this feature. Today’s article shows you how to use these opcodes and takes a first stab at improving performance with them. Are they really all they’re cracked up to be?

Read the rest of this entry »

Tags: , , , , ,

28 Comments