Stephen Calender Programming Blog


Sprite versus MovieClip


Apr 12

Posted: under ActionScript 3.0 Benchmarks, Optimization.

SpriteVsMCGraph

For years I have heard horror stories about the bad performance of Flash’s MovieClip class, so much so that I have aggressively replaced as many objects as I can with Sprites. Obviously MoiveClip objects use a bit more memory, but how much more processing time do they take compared to Sprites? When exactly do they become expensive? Does it matter how you have your display list organized (according to Adobe, shallower is better; however, we do not have a cost comparison)? Surprising answers and discoveries are abound! MOAR!!!

Comments (0)

Faster Rectangle Class


Nov 15

Posted: under ActionScript 3.0, ActionScript 3.0 Benchmarks, Optimization.

“An underlying theme I have discovered with Flash is that you are often better off writing your own code than trusting Adobe’s classes and functions, data structures are no exception.” – taken from my flash particle system article

After the launch and first few patches of Lego Universe, work at NetDevil has calmed down enough that I have the time and energy to explore private projects again. The current project I am working on is large and it is still in the design, test, research phase since it needs to very optimized. I saw that I was going to be doing quite a few rectangle intersects and intersection operations (the function that determines whether two rectangles overlap and the function that returns the overlapping rectangle respectively) so I took a look at the speed of Flash’s native rectangle class. I clocked Flash’s intersects function speed at over 150 simple operations (adds, multiplies, and accessing class members all count as one simple operation from my benchmarking series). I thought to myself “I can do better than that” – I was right, and I managed to write a faster intersection function too (free code).

MOAR!!!

Comments (5)

Benchmarking: Results


Dec 21

Posted: under ActionScript 3.0 Benchmarks.

Sweet Sweet Benchmarking

A speed comparison across all trials. If you would like to view the full results they are available in cvs, htm, and xls formats.

MOAR!!!

Comments (4)

Benchmarking: Graphics


Dec 21

Posted: under ActionScript 3.0 Benchmarks.

These trials are concerned with rendering speed as well as common manipulations and methods of art assets. MOAR!!!

Comments (1)

Benchmarking: Data Structure Speed


Dec 21

Posted: under ActionScript 3.0 Benchmarks.

Data structure trials focus on comparing speeds of variables, object types, classes, and the speed at which you can access and modify your data. MOAR!!!

Comments (2)

Benchmarking: Operation Speed


Dec 21

Posted: under ActionScript 3.0 Benchmarks.

The fundamental speed hierarchy, bit shifting < addition < multiplication < division, is true for all languages. However, it is still important to know the speed difference between operations. Furthermore, the basic operations have many different flavors in which they can be written. All of these trials compare basic operation speed, alternative syntax, and mathematical substitutions. MOAR!!!

Comments (0)

Benchmarking: Methodology


Dec 21

Posted: under ActionScript 3.0 Benchmarks.

I know most of the die-hard critics our there are going to want to see my code, and that is perfectly acceptable. As I have already stated myself, many of the people trying to figure out this black box do a poor job. Just do not expect all of my code to be made public, if you want to grab the source it is available here. MOAR!!!

Comments (2)

Benchmarking: Introduction


Dec 21

Posted: under ActionScript 3.0 Benchmarks.

Not everyone needs to worry about writing the most optimized code. In fact, if you are programming Flash websites or small projects you probably should not be concerned with it – some would even argue that it would be inefficient since more optimized code takes more care to write. However, there are those projects that are large or complex enough that it is essential, and many times, we have a very vague idea of where to draw the line between simple and complex. MOAR!!!

Comments (5)