[web] why is flash on the psp so slow

Started by
1 comment, last by Byron 17 years ago
how slow? a 200+ mhz psp machine is slower than my old 3.5mhz machine running basic ok both languages are runtime interpreted but flash though does have an additional pre compile phase where i assume the code is better organized, thus should have the upper hand i suspect the psp flash version is crippled, eg if i draw say a 16x16pixel person at the top of the screen i may get 20fps but if i move him to the bottom the framerate drops down to ~12fps!!! gah. anyone got any speedtips for the psp WRT flash. heres one do #2 instead of #1

1/ if ( A && B && C ) do ...
2/
if ( A )
{
  if ( B )
  {
    if ( C ) do ...
  }
}
Advertisement
The PSP is slower because it is not designed to run Flash. It is designed to run the PSP's native game format in the PSP's native runtime environment. The Flash environment interferes with the PSP's always-active runtime environment, causing serious compatibility issues when the Flash runtime environment is trying to access a larger amount of system resources. When the Flash environment requests more system resources, the PSP environment examines the request before allowing it, which causes the Flash environment to examine the PSP environment's request. Once the requests are verified, the system resumes, but the redundant requests fill up the processor cache real quick-like. It's like running several instances of a 3D video game. The two game engines get confused with one another, and lock out the computer while they try to figure out which one is doing what. This effectively crashes a computer.
Actually I think the answer is a bit more fundamental than that.

I have worked on the PSP and I can't go into specific details because of NDA issues but I can speak in general which applies to all platforms that use triangles as their basic method of rendering.

The PSP is a small resource device. It doesn't have a lot of memory and it doesn't have a powerful processor. It relies on correct programming methods to get maximum performance out of it. You also have to be careful with the type of assets you use (i.e. texture sizes and bit depths).

Now, along comes Flash. Flash was designed for the web not for small devices like the PSP (although there is a Flash lite out there but I haven't tried it). Flash also likes to make use of vector based artwork. The problem with vector based artwork is that if you are displaying it on a hardware rendering system that uses triangles as its main rendering primitive then any arbitrary vector shape has to be first tesselated into triangles - and this is not a trivial matter and takes time. In its native format the SWF format specifies vector shapes as line to and curve to instructions which means the PSP would have to do this on the fly and that is going to cause it to slow down. The alternative is to render the vector shapes in sw only but as mentioned the PSP CPU is not a powerful one - so all in all its a lose/lose situation.

In my career in games I have written 3 flash players from scratch that address those issues but they all required pre-processing of the SWF files into a nicer format for the console to deal with - personally I think its mad trying to get a low resource device to try and process native SWF files unless you place some heavy restrictions on what can and cannot be used with it.

Byron
Actionscript Game development
ByronBoxes

This topic is closed to new replies.

Advertisement