RemoteObject vs. WebService performance

by allen 1:08 pm Tuesday, 22 February 2005.

Tom Link has put together a nice little application which shows the performance differences between Remote Object and Web Services…

RemoteObject vs. WebService performance

RemoteObject offers superior performance over WebService. This is increasingly true as the size of the result increases. This performance difference is related to the fact that RemoteObject uses AMF, a binary protocol, while WebService uses SOAP. This is discussed in the Flex Server Performance article at Macromedia.com. I’ve created a simple example that demonstrates the peformance delta between RemoteObject and WebService. I create a CFC method that can return an arbitrary number of records (and where the size of one of the properties in record can be specified). The Flex app exposes the CFC via a RemoteObject and a WebService. You can set the size of the result and compare the response time for each method. Remember that you can use RemoteObject to talk to any server running FlashRemoting (ColdFusion, J2EE, or .NET) by pointing the endpoint attribute to the remoting gateway on the remote server. When doing so, you’ll need to make sure you have a policy file in place on the server, as discussed in a previous post.

Comments (0)



ColdFusion MX Coding Guidelines - Performance Techniques

by allen 10:00 am Tuesday, 8 February 2005.

Nik pointed out to me a hidden article about performance tuning with ColdFusion. It is a good read for those who want to refresh their best practices.

In summary:

Performance “Do’s”
+ Use compareNoCase() for comparing two values
+ Use listFindNoCase() for OR comparisons
+ Use arrays instead of lists - in general
+ Use cfqueryparam to increase query performance
+ Use blockFactor to increase query performance

Performance “Don’ts”
+ Don’t use evaluate(), iif(), structFind(), cfmodule, incrementValue()
+ Don’t use WDDX for hardcoded data

ColdFusion MX Coding Guidelines - Performance Techniques

Appendix: Performance Techniques

Do not optimize unless you know you have a performance problem! In general, readability is more important than performance.

The biggest performance optimizations come from architectural and algorithmic changes, e.g., caching. Poorly written database queries can kill a server - use a query analyzer to sanity check your SQL and take advantage of cfquery’s caching functionality where appropriate.

Performance under load is often very different to ’straight-line’ performance - a change that makes a loop run twice as fast when you’re testing a single request may not have the same effect when a hundred users are hitting your site. Use load testing tools to identify bottlenecks and then think carefully about how to restructure the code to improve performance under load.

Having said all that, here are some code-level “do’s” and “don’ts”. These techniques are usually version-specific and most of these have been verified on CFMX. For the most part they are only important for very performance-sensitive code such as frequently called tags.

Comments (0)



Approaches to Filtering data in Flex

by allen 10:34 am Tuesday, 1 February 2005.

Manish Jethani has just given a nice example of using filtering with a custom data provider. This technique is also used by Matt Chotin in his series on Working with Large datasets in Flex.

I think that the real tension is between when you go to the server for searching and filtering and when you stay in the client. The tension isn’t because this is a difficult technical problem, but rather, you need to keep those details hidden away from the user. The conceptual model of the user should be “I’m just searching and filtering” not “I’m searching against the server now I’m searching against the client’. Obviously such technical details should be hidden.

Making choices on when you move to client searching as opposed to server searching may not be as simple as ‘mixing them together’. It may be dependant upon the amount of data there is, and that may change as the application grows. Each context is different. But below is a list of resources all approach the problem from different angles.

Large Data Sets (Part 1 of Many) - Matt Chotin

Large Data Sets (Part 1 of Many)

This is the first of what will most likely be many postings related to data management and Flex. Our opening topic is a brief discussion on large data sets and how to efficiently transfer them from your application server to the client. I’m going to assume you are familiar with MXML and the components and services that are a part of the Flex runtime.

Data filtering using a custom DataProvider

I just wrote a custom DataProvider with support for filtering. You can download the sample and try it out.

Engineering Rich Internet Applications Dynamic Text Filtering with Large Data Sets

Below is a demonstration of a UI component that is capable of displaying a large data-set of discrete values, which can then be quickly reduced as the user begins to type the value they are searching for. This is a desktop metaphor that many will be familiar with - Microsoft calls it “intellisense” completion in some of its products.

Comments (0)