Select to view content in your preferred language

ESRI Graphics Layer Rendering Performance

1092
3
07-08-2010 05:48 PM
richardboyd
Deactivated User
[ I just found this
http://http://forums.arcgis.com/threads/2599-GraphicsLayer-in-Silverlight?highlight=performance
  as I was about to post the following ... I will check it out further]



We are using the ESRI Silverlight API.
All works OK ... until I try to scale the number of icons to display/render.
We need to be able to scale to 1000's of icons on a map at the same time.
Example ... there are 9300 trees for this project .... and lots of buildings, electrical lines, power lines, high pressure lines, manhole covers, etc.
Often many displayed at same time.

I built a simple spike to compare the rendering of ESRI Graphics Layer vs basic Silverlight Canvas.

This is the ESRI Graphics Layer spike.
http://rem7.info/rgia/GraphicsLayerSpike/ESRIClearGraphicsLayerTestPage.html


There are two buttons,
POINT PictureMarkerSymbol
POINT Image

Both randomly render TreeIcons (Points) to the map.
The resources are defined as,
        <Grid.Resources>
            <esri:PictureMarkerSymbol x:Name="TreeSymbol" Source="xxxxx" />
            <Image x:Name="TreeIcon" Source="xxxxx" />
        </Grid.Resources>

The button labeled "POINT PictureMarkerSymbol" directly calls the "TreeSymbol" resource above for each tree icon.
The button labeled "POINT Image" calls "TreeSymbol" once ... gets its source ... and uses the source to build new PictureMarkerSymbol instances ... one for each new tree icon to be displayed.
They should do about the same thing ... and that appears to be the case.

The TextBox is where you can enter the number of trees to randomly display.
Try 10 ... 100 .... 1000.
It is 1000 that really "hangs" ... sometimes 20+ seconds to render.

The VS2010 solution is zipped here,
http://rem7.info/rgia/code/ESRIClearGraphicsLayerSLN.zip



For COMPARISON ... here is link to similar test ... but where the tree icons are written to a Silverlight Canvas.
http://rem7.info/rgia/SlvPerfSpike/SilverlightPerformanceSpikeTestPage.html


You can enter 10000 enter the TextBox and hit the "Web Images" button ... and it renders fast.



SOOOOOOOOOOOOO .... are we doing something wrong in how we are coding the display of tree icons in the above very simple project???
Is this just an ESRI performance issue?
Only thing we can think of now is to group 1000 into ten groups of 100 ... and display one group at a time ... certainly not something that we planned to do.

Any info would be appreciated.

Thanx.

-richard boyd-
http://rgia.org/
0 Kudos
3 Replies
RexHansen
Esri Contributor
Richard-

   Take a look at the following KB article: http://resources.arcgis.com/content/kbase?fa=articleShow&d=37033.   It discusses a technique for enhancing graphic display when symbolizing points with images.   

-Rex
0 Kudos
richardboyd
Deactivated User
REX

Thanx for solution ... it worked great.

FYI ... 3 options posted online.

#1 - Straight Silverlight
http://rem7.info/rgia/SlvPerfSpike/SilverlightPerformanceSpikeTestPage.html

#2 - ESRI + Silverlight
http://rem7.info/rgia/GraphicsLayerSpike/ESRIClearGraphicsLayerTestPage.html
NOTE: The button "POINT ImageBrush" is your suggested fix.

#3 - BING + Silverlight
http://rem7.info/rgia/bing/PushpinSampleTestPage.html

-richard-
0 Kudos
SantoshV
Emerging Contributor
Hi
Please share code for rendering if possible

I want to render a few hundred lines

🙂
0 Kudos