This page includes some tips for advanced users. If you move around large amounts of data and need the best performance you can get, read this.
Tweaking amfPHP for speed
Get rid of any plugins that you don’t need, as they only slow you down.
Set checkArgumentCount in your config to false. (version 2.0.1 and onwards)
Better use of bandwidth
- Try using gzip compression. It will slow down your server, but can reduce size. It’s a tradeoff here, so the best is to try it and see what works best.
- Make sure you’re using AMF3. If you send a simple request to a service with no data, the server has no way of detecting the version of AMF, so it defaults to AMF0 which is not as efficient. To make sure you’re getting AMF3 and not AMF0, consider adding a simple AS3 specific data field as a dummy parameter, for example an empty ByteArray.
- Object Traits: If you’re sending large arrays of information using AMF, for example 1000 different version of array( one => randomStuff, two => moreRandomStuff), consider using a strongly typed class. For example:
class MyVO{
public $one;
public $two;
}
You can then send 1000 copies of MyVO.
Without the indication that each time this is the same data sent in the form of MyVO, amfPHP sends key/value pairs each time for one and two. However if it knows that its a MyVO, it will just send the values, along with the information that it’s a MyVO.
So the first case looks something like this:
Obj one bla two bla2 obj one bla3 two bla4
whereas case 2 looks something like this:
MyVO bla bla2 MyVO bla3 bla4
This is of course only true for AMF, as other formats don’t have such advanced encoding features.





mmostafa
getting rid of any plugin makes errors in entry point page
also changing checkArgumentCount to false does not differ in performance..
i found that the performance of httpservice is better than amfphp !!!
so how can i make amfphp better perfomed than the http service?
any help
mmostafa
another issue
i have constructed an array of objects in php to receive in flex.
but when i received the array in flex , i found that each object in the array contains only one field of the object fields.
i wonder why this happens?