Question

I am new to AMF and I learned that AMF is supposedly very fast.

I was wondering if I should use it for all my web services. Is it still fast without flash VM?

Was it helpful?

Solution

This question could have two answers. One answer is about AMF as a protocol, the other answer is about implementations.

As a protocol, AMF produces small output that has much of the redundancy stripped out. As compared with a similar SOAP implementation, AMF will use fewer bytes of network traffic. In some applications this could be thought of as "faster".

AMF can also be fast if the implementation which encodes the AMF is fast. The Actionscript VM can encode it pretty quickly. However, you state you will not be using the Flash VM. In that case, you might be thinking of using Python. For Python, there are two open source choices: PyAmf and AmFast. AmFast is reportedly eighteen (18) times faster than PyAmf for encoding purposes.

So the ultimate answer is this: determine what kind of "fast" you desire, compare the capabilities of the encoders you can choose from.

OTHER TIPS

AMF was specifically designed for Actionscript, but it is just a binary format based on SOAP. You could use it anywhere, but both the client and server would need to understand AMF.

There are many libraries out there for many different server side languages to understand AMF, but I am not too sure where else you would want to use AMF on the Client-side except for Flash.

AMF is fast in the sense that, compared to other formats you could use, it's:

  • smaller, so responses take less time to transfer over the network than they would in bigger formats (which affects you no matter what you're using AMF with), and
  • closer to the native format of the client, so there's less parsing work for the client to do (which is mainly a benefit with Flash Player, though it's still probably closer to any client's native form than e.g. XML).

There's a good comparison of AMF's performance against other protocols/formats used with Flex at: http://www.jamesward.com/census2/, but I haven't seen a comparison that covers the performance of any other AMF client (even James Ward's own pure JavaScript AMF decoder).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top