Java Reference
In-Depth Information
My broadband Internet connection was used for these tests; as always, the speed of the net-
work will have a large effect on the times reported (see Table 10-14 ).
Table 10-14. Average response time for RESTful scenarios
Average response time Size of data
1-year data
90 ms
30 KB
1-year summary
30 ms
60 bytes
5-year data
300 ms
186 KB
2 summary requests 60 ms
2 calls; 60 bytes each
10 summary requests 280 ms
10 calls; 60 bytes each
The time to retrieve a full year's worth of data is not particularly longer than retrieving just
the summary data, and if the user is expected to need three individual pieces of that data, re-
turning the entire set of data at once is always better.
The 5-year summary is a little different: it takes much longer to marshall and transmit that
data, so the user would need to make 11 drill-down requests before the total time approaches
The times in this example include time to marshall the JSON data being returned from the
RESTful service, and that time is dependent on the number of years the data represents. But
requests could come in from multiple clients for the same set of data, in which case previ-
ously marshalled data could be reused. If the marshalled string is already calculated, then the
inflection points in the trade-off are quite different, as shown in Table 10-15 .
Search WWH ::

Custom Search