Communicating between Flex and .NET


This section will give you an idea how the discussed methods compare to each other in terms of performance. To visually compare the three different methods, we employed three charts which you can see below. The first chart (see Figure 4) compares the three methods against each other with the web, HTTP, and AMF services hosted locally, where bandwidth is not an issue. HTTP services hold their own against Remoting, while the high overhead of each Web service call clearly makes them the also-ran here.

A time-per-call comparison of the three communication methods when hosted locally

Figure 4. A time-per-call comparison of the three communication methods when hosted locally

In the second chart (see Figure 5), the bandwidth is being throttled artificially at 512 KB/s using the Charles Web Debugging Proxy to emulate services being consumed over a typical Internet connection. In this more realistic scenario, all three methods slow down, but HTTP services take the biggest hit, coming closer to the performance of web services than Remoting. This is due to the inefficient XML format of HTTP services, which makes an impact on speeds when bandwidth is taken into account. Still, web services remain the slowest, with Remoting leading the pack.

Another speed comparison, but with bandwidth throttled to a realistic 512 Kbits/s

Figure 5. Another speed comparison, but with bandwidth throttled to a realistic 512 Kbits/s

The third chart (see Figure 6) compares the packet size depending on the number of students included in the ClassData object. As was mentioned before, due to AMF being a binary format the packets it sends are consistently smaller than both HTTP and web services by about a factor of ten.

A comparison of the packet sizes sent by each method

Figure 6. A comparison of the packet sizes sent by each method

As you can see, the slightly more complicated setup of AMF is amply compensated with its excellent performance and bandwidth efficiency. A tenfold packet size difference together with its very short call times leaves HTTP and web services behind. If we take into account other factors such as mileage, type of data that is being sent, and HTTP compression, the relative performance of the discussed methods can change.

Advertisements

~ by mjcprasad2000 on May 2, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: