Select to view content in your preferred language

Did any one else notice a slow down is Serialization from QueryTask from 2.2 to 2.3?

1277
3
01-12-2012 11:38 AM
HyrumErnstrom
Regular Contributor
I first noticed it in a FeatureLayer. I then tested a QueryTask for the same features(1000+). It was fast when I didn't return geometry. Then when I switched to returning Geometry it was much slower in 2.3 than in 2.2. I finally switch the whole project to 2.2 and was back to the performance that I was expecting.

My client had thought it slowed down going to 2.2 from 1.x. Is this a progressive thing with each release the performance is getting worse?
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
I'd like to reproduce this bug, what version of ArcGISServer are you using?

I have the following code, please let me know if it needs to be tweaked to get the same performance slowdown that you are experiencing. I will be testing it against latest and previous releases. Using the code below, I did not experience a slowdown between 2.1, 2.2. and latest. If you can share service and/or code, that would help us reproduce the bug and hopefully fix it. Thanks.

What I've noticed is that there seems to be no difference in server response for ReturnGeometry=True and ReturnGeometry=False using sampleserver3. I just learned that this is a known server bug that is planned to be fixed in future releases.
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">

    <Grid x:Name="LayoutRoot" Background="White">
  <esri:Map WrapAround="True" x:Name="MyMap">
   <esri:ArcGISTiledMapServiceLayer ID="MyLayer"
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer" />
   <esri:GraphicsLayer ID="MyGraphicsLayer">
    <esri:GraphicsLayer.Renderer>
     <esri:SimpleRenderer>
      <esri:SimpleRenderer.Symbol>
       <esri:SimpleMarkerSymbol Color="Red" Size="15" Style="Circle"/>
      </esri:SimpleRenderer.Symbol>
     </esri:SimpleRenderer>
    </esri:GraphicsLayer.Renderer>
   </esri:GraphicsLayer>
  </esri:Map>
  <StackPanel VerticalAlignment="Top" HorizontalAlignment="Center">
  <Button  Content="Query" Click="Button_Click"/>
   <CheckBox x:Name="ReturnGeom" IsChecked="False"/>
  </StackPanel>
 </Grid>


DateTime started;
  private void Button_Click(object sender, RoutedEventArgs e)
  {
   var queryTask = new QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/FeatureServer/0")
   {
    DisableClientCaching = true
   };   
   var query = new Query() { ReturnGeometry = ReturnGeom.IsChecked.Value , Where = "1=1"};
   queryTask.ExecuteCompleted += new EventHandler<QueryEventArgs>(queryTask_ExecuteCompleted);
   started = DateTime.Now;
   queryTask.ExecuteAsync(query);
  }

  void queryTask_ExecuteCompleted(object sender, QueryEventArgs e)
  {
   var elapsed = DateTime.Now.Subtract(started).TotalMilliseconds;
   System.Diagnostics.Debug.WriteLine("Elapsed time (ms): {0}", elapsed);
   (sender as QueryTask).ExecuteCompleted -= queryTask_ExecuteCompleted;
   var l = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
   if (e.FeatureSet != null)
   {
    foreach (var f in e.FeatureSet.Features)
     l.Graphics.Add(f);
   }
  }
0 Kudos
HyrumErnstrom
Regular Contributor
Hmm when I started a new project tried to recreate it I didn't find anything like I did from the existing project.

The orginal project started in Silverlight 2.0 and has since been updated to Silverlight 3.0 then Silverlight 4.0. I'm wondering if there is any issues with the various Visual Studio upgrades that have caused this. I will look deeper into this and see if I can see what the issue might be.
0 Kudos
dotMorten_esri
Esri Notable Contributor
I would be interested in what you find. At 2.0 (or maybe it was 2.1 - cant remember) the deserializer was optimized to 2-4 times faster than before (depending on the number of processors you PC have).

However there is also more data that can be requested and thereby deserialized, so if the data you are getting is larger, it might be slightly slower (you can double-check in Fiddler if you get a larger payload back, and they try and tweak the parameters to get the same data).
0 Kudos