10.3. Data Format Optimization

Data can be exchanged between a BlazeDS server and a Flex client in a number of formats, which include both binary and text-based forms. AMF3 facilitates a very efficient way of binary transmission of data between the server and the client. In addition, you can choose to go with a text-based format that could be well structured like XML or delimited like comma-separated or tab-delimited text. JSON (JavaScript Object Notation) and AMFX, where AMF is transmitted in XML, are also options.

In each of these cases, the following performance-related measures need to be considered:

  • Data size—The volume or size of the data in a particular format

  • Server execution time—The time the server takes to serve the data

  • Transmission time—The time the data takes to traverse the wire from the server to the client

  • Parsing time—The time the client-side program takes to parse the data so that it's available for consumption

  • Rendering time—The time it takes to render the data in a UI component on the client side

Although accurately measuring the size and duration intervals in the preceding list is fraught with inefficiencies and challenges, these measures do provide an indication of the scale of differences among the various options. In this section, I will present a way to measure the data size and the execution, transmission, parsing, and rendering time intervals.

For starters, let's measure the execution time on the server. The execution time on the server is not only impacted ...

Get Professional BlazeDS: Creating Rich Internet Applications with Flex® and Java® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.