A Better Performance?

693
5
02-03-2014 11:18 AM
TomWang
New Contributor
Hi,

I would like to use QueryDataSource. Two options I have are to map a query: "esri/layers/ArcGISDynamicMapServiceLayer" or "esri/layers/FeatureLayer'.

Which one has better performance if i have about 4000 polygons?  "esri/layers/ArcGISDynamicMapServiceLayer" or "esri/layers/FeatureLayer (with MODE_ONDEMAND)"?



Thanks,


Tom
0 Kudos
5 Replies
JeffPace
MVP Alum
In general do not use FeatureLayers unless you have to.  They are rendered as graphicsLayers.

Can you cache your service? That would be the best performance
0 Kudos
TomWang
New Contributor
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
0 Kudos
JeffPace
MVP Alum
OK I understand your issue better now.  The generalization of the feature Layer may give you a performance boost. 

However, my advice as always would be, there is no way at a low zoom level someone would be able to differentiate 3000 individual counties, and you would be better served setting up scale dependencies that show states at some scales, and counties only when you zoom in. 

The issue is not the complexity of the geometries (although that doesnt help) it is the quantity, and neither featurelayers nor dynamic layers address that.

That being said, if you must all draw all 3000, aggressive generalization is most likely your best performance target
0 Kudos
TomWang
New Contributor
Hi Jeff,

Thanks for your command on this. Yes, number of polygons is the key of my question. I am totally agree with you about scale dependency from state level to county level in general. But in my case I don't see a better way to give users a big picture about their result analysis. Take a look of this link which i am really like it presents 3221 counties.

http://bl.ocks.org/mbostock/4060606

Displaying 3221 counties is performing well no matter "esri/layers/ArcGISDynamicMapServiceLayer" or "esri/layers/FeatureLayer'. Thanks Esri ArcGIS Server has all the powerful drawing engines.

But I am really looking to display 73642 CENSUS TRACT at this level. Yes, it is crazy!

Please advice!!!


Thanks,

Tom
0 Kudos
JeffPace
MVP Alum
Agreed, crazy 🙂

I think that generalized geometry and FeatureLayers are your only hope..
0 Kudos