Posts Tagged performance

Flash vs. HTML5: Bitmap Drawing Speed

Tags: , , , , ,

HTML5 is all the rage and a lot of Flash developers are either curious about it or have actually made the switch. But how does its performance stack up against Flash? That is a very complicated question, so we’ll begin today with just a simple test of the speed at which a lot of bitmaps can be drawn to the screen. Who will win? Read on to find out.

Read the rest of this article »

26 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

If-Else Trees vs. Array and Vector

Tags: , , , , , ,

We’ve seen that if-else trees are way faster than Object, Dictionary, and even switch at key-value mapping, but how do they stack up against Array and Vector? Today’s article puts them to the test and uncovers some unexpected results.

Read the rest of this article »

8 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

Optimizing AS3 with JavaScript

Tags: , ,

Now that AS3 is performing slower than JavaScript in some areas, should we be looking to optimize our AS3 by offloading tasks to JavaScript? That may sound perverse, but the possibility of major speedups is tempting. Today’s article looks for speedups using Flash’s AS3-to-JavaScript bridge: ExternalInterface.

Read the rest of this article »

12 Comments

AS3 vs. JavaScript Performance Followup (April 2013)

Tags: ,

It’s been about a year and a half 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 article »

19 Comments

String.charCodeAt Is Really Fast

Tags: , ,

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.

Read the rest of this article »

4 Comments

If-Else Trees vs. Objects and Dictionaries

Tags: , , ,

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 Object and Dictionary offer us AS3 programmers? Today’s article finds out!

Read the rest of this article »

11 Comments

ASC 2.0 Conditionals Performance

Tags: , , , , , , ,

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?

Read the rest of this article »

19 Comments

JPEG Compressor Roundup

Tags: , , , , , ,

Now that we’ve determined the best PNG compressors to create PNG images with, let’s delve into the world of JPEG compressors. As with PNG, we have multiple options to choose from in our Flash apps when we’re looking to encode images such as screenshots. Which is best? Today’s article delves into each compressor’s performance and file size efficiency.

Read the rest of this article »

3 Comments