Flex - The Fastest Way to Transfer Data?June 11th, 2009
I've been experimenting with Zend AMF over the last few weeks and came to a startling discovery. The whole reason I wanted to use AMF is that I had read it is the fastest way to transfer data between the client and the server. So I spent some time setting it up and then I ran a test against my old framwork. This framework pulls xml directly from a SqlServer database and then passes the xml directly to the client where it gets parsed into value objects. Unfortunately, MySql does not yet have the ability to return xml from queries (as far as I know). I ran a test under both approaches by pulling 5000 records from the database. In both cases I used php to pull the data from a SqlServer db. Using xml, it took 3 seconds to populate a datagrid while AMF took 14 seconds. I imagine that the main advantage of my original framework is that there is much less work on the server, as it simply queries the db for a single string (xml) and passes it directly to the client. My tests showed that of the 3 seconds it took to complete the whole process, roughly one second was spent transferring the xml from the server to the client and the rest of the time was taken by the client to parse the xml into an ArrayCollection of value objects. The total amount of data sent using AMF was 3.8MB, xml sent was 2.4MB. It's possible that I may have not have optimized my set up under Zend AMF, but I followed the basics that I was able to find on the internet. I'd be curious to know if anyone has any input on this, since it appears that pulling xml directly from the db and having the client parse it appears to be almost 5 times faster than using AMF.
|
![]() RECENT ARTICLES
Stack Error 1023 - My Strange Encounter With Error 1023
Passing Values to a Custom ItemRenderer Using a File Reference to Upload to ASP.net Flex - Create a Dashboard That Allows Drag and Resize Strange Hack For Downloading With a FileReference Using SharedObjects Flex Checkbox TreeItemRenderer Flex - Dynamically Create Time Segments MORE... |
