Archive | December, 2008

CopyPixels and browser speed limits

18 Dec

Can it be true that Flash Player running in the Opera browser on Windows XP is more than 4 times faster than Safari on the Mac? It certainly looks like that and I need some help testing…

graffiti.jpg

I’m currently working on a project where I need to offset some bitmaps and I stumbled upon a very interesting speed difference among browsers. I’m shifting a bitmap along X and Y using the copyPixels function. This is apparently the fastest way to set an offset on bitmapData, but the browsers seems to have their own speed limitations? The difference between Safari on OSX and Opera on XP is downright scary…

The test file is set to play at 900 fps, so the results you are getting will be the maximum of what your browser is capable of. If you have the time write a comment with the results you are getting and I’ll add it to the table below. Make sure you specify your CPU speed and that you don’t have other software running that’ll steal CPU time (such as Spotify). Here is the test file and for those in need of an image scrolling class, here’s the AS3 class and the class to create the test as well. (The image is a neat graffiti I found just up the street from Bill’s in Brighton).

PS: I know the Flash IDE can’t be set to more than 120 fps, but in a Flex actionscript project you can set it to 999fps without any problem…

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
BrowserOSCPU speedPlayer versionFps result
FirefoxMac OS 10.5.52 x 2,8 GHz Quadcore Xeon10,0,12,3654
 Mac OS 10.5.52 x 2,8 GHz Quadcore Xeon9.0.124.055
 Mac OS 10.5.62,4 GHz Core 2 Duo10,0,12,3660
 Mac OS 10.5.52,4 GHz Core 2 Duo10,0,12,3634 (?)
 Mac OS 10.5.52.1 Ghz Core 2 Duo10,0,12,3649
SafariMac OS 10.5.52 x 2,8 GHz Quadcore Xeon10,0,12,3660
 Mac OS 10.5.52 x 2,8 GHz Quadcore Xeon9.0.124.062
 Mac OS 10.5.62,4 GHz Core 2 Duo10,0,12,3653
 Mac OS 10.5.52.1 Ghz Core 2 Duo10,0,12,3643
OperaMac OS 10.5.52 x 2,8 GHz Quadcore Xeon10,0,12,3619
 Mac OS 10.5.52 x 2,8 GHz Quadcore Xeon9.0.124.014
FirefoxWin XP2 x 2,8 GHz Quadcore Xeon10,0,12,36133
 Vista Ultimate3 Ghz Core 2 Duo10,0,12,36130
 Vista 64bit2.6 Ghz Core 2 Duo10,0,12,36136
 Win XP2.5 Ghz Quadcore Xeon10,0,12,36139
 Vista Ultimate2.4 Ghz Core 2 Duo10,0,12,36134
 Win XP2.4 Ghz Core 2 Duo10,0,12,1072
 Win XP (Parallels)2.4 Ghz Core 2 Duo10,0,12,36137
 Vista 64bit2.0 Ghz Core 2 Duo10,0,12,36136
 Win XP1.8 Ghz Core 2 Duo10.0.12.36130
ChromeVista Ultimate3 Ghz Core 2 Duo10,0,12,36120
 Vista 64bit2.6 Ghz Core 2 Duo10,0,12,3680
 Win XP2.5 Ghz Quadcore Xeon10,0,12,36115
 Win XP2.4 Ghz Core 2 Duo10,0,12,10104
 Vista 64bit2.0 Ghz Core 2 Duo10,0,12,3680
OperaWin XP2 x 2,8 GHz Quadcore Xeon10,0,12,36279 (!)
 Vista Ultimate3 Ghz Core 2 Duo10,0,12,36134
 Vista 64bit2.6 Ghz Core 2 Duo10,0,12,36166
 Win XP2.5 Ghz Quadcore Xeon10,0,12,36240
 Win XP2.4 Ghz Core 2 Duo10,0,12,10180
 Vista 64bit2.0 Ghz Core 2 Duo10,0,12,36142
SafariWin XP2.4 Ghz Core 2 Duo10,0,12,10144
IE8Win XP2.5 Ghz Quadcore Xeon10,0,12,3663
IE7Vista Ultimate3 Ghz Core 2 Duo10,0,12,3664
 Vista 64bit2.6 Ghz Core 2 Duo10,0,12,3665
 Vista 64bit2.6 Ghz Core 2 Duo10,0,12,36136
 Vista Ultimate2.4 Ghz Core 2 Duo10,0,12,3664
 Vista Ultimate2.4 Ghz Core 2 Duo9.0.115.064
 Vista 64bit2.0 Ghz Core 2 Duo10,0,12,3665
IE6Win XP2 x 2,8 GHz Quadcore Xeon10,0,12,3663
WebkitNokia N8000.33 Ghz TI OMAP 24209.0.48.08 grin
WebkitPS33.2 Ghz CELL9.0.124.065

Away3D doughnut?

12 Dec

Been working on the final Away3D primitives tutorial for Flashmag today. So what do you use a Torus for other than a Doughnut? Speaking of Doughnuts - anyone remember how The Swedish Chef made them?

dougnut.jpg

The tutorial should be finished soon. Hopefully this weekend.

ArgumentError: Error #2004: One of the parameters is invalid

03 Dec

Just figured that Flex will start throwing this error if you don’t set the width and height your AIR application. It makes sense - an application needs to have a width and height, but for a second, I forgot that I was making an AIR app and not a Flex project.

Just thought I’d post it here in case others get the same problem. This error happens in Flex also, but for other reasons. It’s a little annoying that these error messages are so useless when they could have said something like “Required parameter missing in MXML”...