28 May 2009

Flash 10 speed tests

by Rob Bateman Flash 10 speed tests

Sometimes coming from only one side of a problem restricts your view on the best way to evolve. In recent experiments with the latest Flash10 player, we have been testing how starting from a native cs4 approach fares when constructing a 3d framework, and have discovered a few interesting facts about Flash 10's renderer. Some of these nuggets include the following:

  1. DisplayObject sorting is a much faster option than triangle sorting.
  2. Fixed length Vector data stores are faster than linked lists when it comes to manipulating large data sets.
  3. Sorting using index references is much faster (and easier) than ordering screenvertex vectors
  4. ...
The above demo is one such test, and nicely illustrates where we feel Away3d is going after the textfields/shapes merge that will be version 2.4. Click to add more globes - speeds vary between machines but it seems most that have tried the test can manage up to 20,000 unsorted triangles, still running at 30fps. Moving you mouse to the right or left side of the screen will switch the current z-sort algorithm on or off, and you can see with higher numbers of triangles there is a significant performance drop when sorting is activated. This uses a brute-force method  - in more recent tests it seems a better approach is to sort in convex groups, and we will hopefully be able to post more on this soon. The Away3d Team


29 May 2009 02:06 AM

jkozniewski said:


Look promising smile
Colud you explain though why Away 3D FP10 branch is so much slower
compared to PV3D which make no use of new drawing API ?

I experienced big drop in performance im my own project when using Away3D ( no offence guys, just facts ) and it's also well tested here - http://clockmaker.jp/blog-en/2009/05/away3d_vs_pv3d/.
I suspect that it's connetced with perspecitve correct bitmap distortion
which is actualy slower than affine transformations even if it looks pretier and helps to lower
number of polygons on flat surfaces.

Am I right ? Don't you think that it woluld be desirable feature to have an opt-out from perspetive corrected drawing
to pre FP10 way ? Then one could optimize the scene better - apply perspective correction to floor and walls but
use faster afine transforms for objets/surfaces that don't really need perfectly accurate texture rendering ?

Thumbs up for the great work !

29 May 2009 05:40 AM

Exey said:

18 FPS on 50160 Faces with ZSort = false

AMD Athlon 64 X2 Dual 2.71Ghz, 2GB RAM

29 May 2009 09:29 AM

Rob Bateman said:


the speed tests on the clockmaker blog are a little biased, because the flash10 drawtriangles in it's basic form actually slows down the rendering process. If you were to compare the flash10 branch of papervision with the flash10 branch of Away3d, you would see a much closer speed comparison.

The above demo illustrates where we are coming from with the next major flash10 update. Keeping current features in Away3d means that ultimately we can't hit 20,000 tris at 30fps, but we are testing (with some success!) the possiblity of turning off features like interactivity and sorting in order to allow maximum speed for those that require nothing else.

29 May 2009 11:20 AM

jkozniewski said:

@Rob Bateman

Ok I understand wink I was just a bit ( unplesantly ) supprised that FP10 branch is actually slower than
older ( FP9 ) engines and your explanation seems to confirm my suspicion that new features
like drawTriangles with UVT are not always the fastest way to render vast number of polygons.

I just wonder what's "not basic" form of drawTriangles that could outperform old ways of drawing ?

Whats more... colud please comment on idea of flexible renderer that could mix new and old
way of drawing ( since it seems that in some cases the old, I mean affine transforms here, way is faster and sufficient in terms of apperance ).

29 May 2009 02:16 PM

Rob Bateman said:


Well, drawTriangles can be pretty fast as you can see from the above demo, if used correctly. The reason why this is not currently the case in the flash10 branch of both Away3d & Papervision, is that the old render techniques separated each triangle draw routine into it's own method call. drawTriangles works best when a whole bunch of triangle data is rendered at once, and this requires some fairly hefty re-writing of internal data structures as you can imagine. However, we expect to be looking at the options very soon, and will of course update everyone with progress when we have more.

30 May 2009 07:46 AM

DonPaolo said:

20 FPS on 50160 Faces | ZSort = false

AMD Phenom II X4 940 | 3 GB RAM

22 Jun 2009 04:33 PM

makc said:

@Rob, in other words, you are not going to keep affine rendering in any way, right? I heared older tests found no significant difference between series of drawTriangles calls and single call performance, has this changed now?

22 Jun 2009 04:42 PM

makc said:

oh yeah, the results,
in high quality, 6840 faces run at 23(31) fps with zsort on(off)
in low quality, 53200 faces run at 3(4) fps with zsort on(off)

(feel compelled to point out that sandy was sorting in groups since forever, whoever came up with that idea - Thomas? - is a smart guy)

29 Jun 2009 04:56 AM

zszen said:





21 Jul 2009 01:09 PM

Jesse Nicholson said:

Honestly I've been digging around looking into all of the flash 3D engines and to me away 3D looks the best, might arguably not perform the best RIGHT now but I think is the most promising. I've messed around with papervision and at that time didn't like my scenes freezing every 5-10 seconds getting choked up refreshing.... don't know how much better it is now but..

Anyway with 28880 faces amd X2 64 (on 32 bit plat) 3 gigs ddr2-800 getting about 20 fps avg.

25 Apr 2010 01:13 PM

Dominik said:

first id like to point that the FLASH 10 SPEED TEST is most likely to be biased. If u analyse carefully this demo you will see that u add more triangles but u can also see that those triangles are smaller as you add them. So u add more triangle but they are each time smaller so its not necesseraly more pixel drawn on screen.


29 Oct 2010 01:08 AM

Bruno said:

How can I improve this?

I was thinking of switching an application from PV3D to Away3D thinking that performance would increase and, the following test just got me concerned about it. In PV3D I was able to have many more cubes with many different textures of about the same size and performance was significantly better in PV3D. Also, I've noticed that the Renderer.CORRECT_Z_ORDER option will kill the frame rate significantly, even when no objects are intersecting.

I'm using Away3D 3.6.0 (FP10) and latest AIR 2.5 to run it (I'm on an AMD Athlon 64 X2 Dual 2.71Ghz, 2GB RAM).

import away3d.core.base.Object3D;
import away3d.tools.utils.Drag3D;
import away3d.core.base.Vertex;
import away3d.events.MouseEvent3D;
import away3d.debug.AwayStats;
import away3d.containers.*;
import away3d.core.math.*;
import away3d.core.render.Renderer;
import away3d.core.utils.Cast;
import away3d.materials.*;
import away3d.primitives.*;

import flash.display.Bitmap;

import mx.core.UIComponent;

[Embed (source="marlboro-classics.jpg")] // Small image of 80x180 pixels
private var marlboroClass:Class;
private var marlboroBitmap:Bitmap = new marlboroClass();

public var view:View3D;
private var drag3d:Drag3D;

private var cube:Cube

private var holderUI:UIComponent = new UIComponent();

public function onCreationComplete() : void
this.addEventListener(Event.ADDED_TO_STAGE, init3D);

public function init3D(event:Event) : void
this.view = new View3D({x:800, y:600});
//this.view.renderer = Renderer.CORRECT_Z_ORDER; // This really, really slows things down (50 cubes and FPS was down to 0 if all cubes are in same position???


// Add Draggable Cube
var marlboroMaterial:BitmapMaterial = new BitmapMaterial(Cast.bitmap(marlboroBitmap));

for (var xx:int = 0; xx < 20; xx++)
for (var yy:int = 0; yy

Only registered members can comment. Click here to login or here to register