Archive for December, 2009

Linked Lists: Part 3

Continuing in the series on linked lists that started with parts one and two, today I’ll make the first serious optimization pass on the LinkedList implementation. Read on for how successful this is.

Read the rest of this entry »

Tags: , ,

1 Comment

Linked Lists: Part 2

Last time I began covering linked lists in AS3. As anyone who has ever taken a data structures class can tell you, this is definitely a core data structure. As such, it has numerous benefits compared to other single-dimensional data structures like arrays and hash tables. The Array class in AS3 is far from a C/C++ array, which is simply a contiguous block of memory. AS3′s Array class blurs the lines between arrays, linked lists, and hash tables. So as I implement a linked list class in AS3 it is quite interesting to see how the normal pros and cons change. I’ve expanded on the LinkedList class I started last week and done some more preliminary performance testing. Read on to see the updates.

Read the rest of this entry »

Tags: , ,

2 Comments

Linked Lists: Part I

I’ve written before about linked lists when I covered free lists. There were massive speedups to be had there, but that article mostly covered the performance costs of allocation and deallocation. Today is part one of a series that more generally covers linked lists.

Read the rest of this entry »

Tags: , ,

6 Comments

AS3 vs. JavaScript Performance Test Followup

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.

Read the rest of this entry »

Tags:

9 Comments

Array 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?

Read the rest of this entry »

Tags: , ,

6 Comments

Miscellaneous Utility Functions

The last three articles have been about utility functions for objects, classes, and display objects. This is the finale in the series and contains some leftover utility functions.

Read the rest of this entry »

Tags: , , ,

3 Comments

Utility Functions For DisplayObjects

Hot on the heels of my articles about utility functions for objects and classes, today’s article has a set of utility functions for DisplayObjects.

Read the rest of this entry »

Tags: ,

10 Comments

Utility Functions For Classes

On the heels of last Friday’s article on Utility Functions For Objects, today’s article will show a few utility functions for the Class class. In case you’re not familiar with it, Class represents a class like you would write and is useful main for more dynamic programming where you want to instantiate a class based on a variable (eg. var c:Class) rather than a constant (eg. BitmapData). So how do you get a Class variable? The Flash API provides some ways to go about it and I’ll provide some ways to make that more convenient.

Read the rest of this entry »

Tags: ,

8 Comments

Utility Functions For Objects

Like most programmers writing non-trivial applications, I’ve piled up a lot of utility functions over the years. Most of them are simple and effective. They are short and get their job done. You or someone you know has probably written these functions, but maybe not in AS3. So today I’m going to share a few utility functions for Objects in AS3.

Read the rest of this entry »

Tags: ,

11 Comments

Fast Line Drawing

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.

Read the rest of this entry »

Tags: , , ,

14 Comments