Posts Tagged performance

Compile Time Only

Tags: , , , , , ,

The const and final keywords only apply at compile time. Despite having written about const and final before, readers frequently ask me about these two keywords. Today’s article will answer the question and definitively show that these keywords only apply at compile time: not runtime. UPDATE: const is still just a variable as far as performance goes, but its protections do extend to runtime.

Read the rest of this article »

13 Comments

How To Use a Profiler To Get Better Performance

Tags: , , , ,

The site has had many articles about improving the performance of your app, but never discussed the basic methodology on which all optimizations should be based. Today’s article will go over a scientific approach to optimizing that makes use of a tool known as a profiler and demonstrate using an AS3 application just why it’s so important to usage such a tool.

Read the rest of this article »

23 Comments

Stage3D Draw Calls: Part 3

Tags: , , , , ,

So far we’ve seen how to use Stage3D to get massively increase performance with hardware acceleration, but that performance has come at a cost: we must use the same texture for each object we’re drawing. Today we’ll smash that requirement without losing an ounce of performance!

Read the rest of this article »

13 Comments

Stage3D Draw Calls: Part 2

Tags: , , , , ,

Today’s article shows you how to get great performance with a ton of sprites by reducing your Stage3D draw calls. As we saw last time, Stage3D performance is not guaranteed to be good and falls significantly below normal 2D Stage performance even on expensive tasks like scaling and rotating Bitmap objects as well as redraw regions covering the whole stage. Today we’ll show how to overcome those performance problems and beat the tar out of the 2D Stage.

Read the rest of this article »

5 Comments

Stage3D Draw Calls: Part 1

Tags: , , , , ,

There’s no doubt that Flash 11’s new Stage3D API can produce some amazing results by giving us access to the power of the user’s video card/GPU. However, it’d be a mistake to blindly assume that it is always faster than the traditional Flash display list (i.e. Stage). Today’s article begins a series that discusses the topic of “draw calls” and how they heavily impact the performance of your application.

Read the rest of this article »

24 Comments

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