Today’s article is a followup to an article I wrote in August comparing the performance of AS3 (Flash Player) and JavaScript (various browsers). Since then, two browsers have been updated to new versions and both have claimed speedups in their JavaScript implementations. Today’s article tests those new browser versions to see their speedups in the context of our benchmark: AS3.
Posts Tagged performance
Today’s article is inspired by Jean-Philippe Auclair’s excellent article on arrays and the comment he recently posted on my article about map performance. In it he discusses how the Array class is implemented using a densely-packed C/C++ array (a contiguous block of memory) and, after the first undefined element, a hash table. This got me thinking of three questions, together the subject of today’s article. First, when an Array‘s densely-packed portion is split using the delete operator, how fast is this? Secondly, can it be re-joined? Third, how fast is rejoining it?
A recent post by Simo Santavirta featured an algorithm with an irresistible name: Extremely Fast Line Argorithm. A comment on that article piqued my interest and I decided to test the algorithm out against Adobe’s Graphics.lineTo.
MXMLC’s -define feature allows you to do two things: compile-time constants (as covered previously) and conditional compilation. Both are very useful, so today I’m covering conditional compilation.
I’ve recently been seeing more and more usage of while loops by those who I presume are interested in performance. I’ve always assumed that these was not faster than for loops, but today I am finding out.
The BitmapData class is among the most useful classes in AS3. When it was introduced in Flash 8 it dramatically improved Flash development by opening up new potential for features and optimization. Since it’s used so often, it’s good to know as much about it as possible. Today I’m going to cover the performance difference that turning alpha (a.k.a. transparency) on makes.
I recently received an e-mail from Dmitry Zhelnin (translation) with a test he did concerning the speed of a couple ways to get a value for a key, which I like to call a map and Wikipedia likes to call an associative array. I’d been meaning to do a similar test for a while now and, guess what, I finally have! UPDATE: fixed miss test for fixed-size Vectors.
Alec McEachran’s latest article about constants reminded me of a trick I’ve recently learned and became a big fan of. His article expresses the pain endured by those who wish for both speed and maintainability in their AS3 apps. The solution the article doesn’t reach though is that of compile-time constants. This is truly the best of both worlds, so let’s learn about it.
For a variety of reasons, you may need to communicate between two Flash Player instances. You may do this to implement debug logging, communicate with a mini game, or coordinate between a main SWF and an advertisement SWF. So, what kind of speed can you expect? This article will show you.
As a followup to my article on Inlining Math.ceil(), I decided to inline some more functions in the Math class. Read on for the code as well as tests proving correctness and speed.