Thanks Jeff,
To cache my service is not option for me. Sorry for confusing my question. I am using QueryDataSource which is a dynamic data source, such as "SELECT * FROM sde.sde.states_geom" also with join data tables as well. A query is dynamically created based on a web user's request.
When using a Feature Layer in ONDEMAND mode, the ArcGIS API for JavaScript intelligently handles retrieval of features using two techniques: vector tiling and feature generalization. The advantage of this is that developers do not have to set up an event listener for map level changes, calculate a value for maxAllowableOffset and set the value on Feature Layers- it is done automatically. But it dose have MaxRecordCount, of cause you can change this value if you need. But it gives me a sense is that the Feature Layer may have a performance issue if I increase MaxRecordCount = 4000 to compare with ArcGISDynamicMapServiceLayer & queryDataSource with no limit.
As a reference, I have used ArcGISDynamicMapServiceLayer with a querydatasource for USA 3221 counties in a Silverlight version. the performance is good. Now I am creating a JavaScript version. I wold like to find a better solution. Maybe Vector Feature Layers are a better option.
Please advice!!!
Thanks,
Tom