Archive for category AS3

Compression Speed

Tags: , , ,

Flash makes it very easy to compress data- just call ByteArray.compress. It’s just as easy to uncompress with ByteArray.uncompress. With such convenience, it’s tempting to compress every ByteArray you send across without a second thought. But is this really a good idea? Will compressing every packet you send over a socket slow your app to a standstill? Today’s test is designed to answer just this question. Read on for the test and results!

Read the rest of this article »

9 Comments

Repeatable Random Performance

Tags: ,

A couple of years ago I posted a class that generats pseudo-random numbers in a repeatable way. This is useful for a variety of tasks, but a recent comment reminded me that I hadn’t tested its performance. Today I’ll pit my repeatable random function against the standard Math.random function as well as Skyboy’s repeatable random class. Read on for the results!

Read the rest of this article »

20 Comments

Why Static Is Slow

Tags: , , , , ,

Using static variables and functions is slow. That was the conclusion of the previous article on statics, but the subject is actually more nuanced than that. Today we’ll explore static more in-depth and find out just why it is so slow.

Read the rest of this article »

26 Comments

Simple 2D With Stage3D

Tags: , , , , , , , ,

Along with Flash Player 11’s new Stage3D class have come hardware-accelerated 2D rendering engines. Impressive results have already been demonstrated by advanced engines like Starling and ND2D. Today’s article shows a simple Stage3D-based sprite class to help learn more about how these engines are implemented and provides a simplified alternative to the more complex 2D engines that still delivers hardware-accelerated performance.

Read the rest of this article »

10 Comments

Serialize Anything: Part 2

Tags: , , , , , , , , ,

One of the new features in Flash Player 11 is a native JSON encoder/decoder class. In the Serialize Anything article, I neglected to add JSON as an option for serializing and deserializing arbitrary objects. In today’s followup we’ll take a look at the performance of the native JSON class and compare it to ByteArray.readObject/writeObject and XML.

Read the rest of this article »

10 Comments

Static vs. Non-Static

Tags: , , , , , ,

Tip #8 in my Top 10 Performance Tips For 2012 was to reduce static accesses of variables, functions, etc. in favor of non-static variables and, especially, local variables. I neglected to reference one of my articles and it was pointed out to me that I hadn’t actually written such an article! So today I’ll elaborate on my tip and show why you should prefer non-static and local variables so you can find out just why it deserves its place as a top tip.

Read the rest of this article »

19 Comments

Top 10 Performance Tips for 2012

Tags: , , ,

It’s a new year and it’s time to make some New Years resolutions for Flash performance. Today’s article is a collection of what i consider 10 top tips for improving the performance of your Flash apps. Read on for the list!

Read the rest of this article »

17 Comments

Introduction to AGAL: Part 3

Tags: , , , , , ,

Continuing from last time, in today’s article we’ll discuss the process of building and using basic shaders. This forms the basis of all Flash 11 Stage3D engines, so you’ll be learning how hardware-accelerated 3D shaders are built from the ground up.

Read the rest of this article »

9 Comments

Introduction to AGAL: Part 2

Tags: , , , ,

To continue the series on Flash 11 Stage3D shader programming, this week we’ll take a look at the data types your shader has available and finally dive into some actual AGAL assembly syntax.

Read the rest of this article »

9 Comments

Introduction to AGAL: Part 1

Tags: , ,

Flash 11’s new Stage3D class introduces a whole new kind of bytecode to Flash: AGAL. Today I’m beginning a series of articles to talk about what AGAL is in the first place, how you can generate its bytecode and, more generally, how these wacky shaders work. Read on for the first article in the series and learn the basics of AGAL.

Read the rest of this article »

17 Comments