ThinkGeo.com    |     Documentation    |     Premium Support

Winforms or WPF version?

I found this comment on one of the forums asking how they could speed up map rendering.


Are you using WPF or Winforms. WPF is much slower as they do not expose a BufferGraphics object like Winforms does.


Would you recommend Winforms version instead of the WPF version because Winforms is faster?


Is the speed rendering that different or is it minimal?


Are there any tricks to override the draw core method to speed up WPF map rendering?


I'm not experiencing any significant performance issues but I would like my app to be as fast as possible.



Peter, 
  
 Thanks for your interests in Map Suite products. 
  
 Up to now, there is no WPF native drawing for WPF control, we still use the GDI+ to draw the image and then convert the image it into WPF image, so I think this will a bit slower down for WPF control, while it is very hard for me to believe it will cause great performance difference.   We are now considering developing a native drawing WPF control in future. 
  
 The Override of DrawCore method will only can be applied to Layer or Overlay which exists both in Winforms Map or Wpf Map. 
  
 In Desktop application, there are a couple of ways to enhance the performance; the first basic way to improve the performance is pre-generating tiles for your application, which can be applied both in Winforms and Wpf apps. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


Peter, 
  
   If this is a new project I would go with whatever system you are more comfortable with.  Now that we have all of our 3.x products out the first big push will be on performance.  We have a number of ideas on how to improve performance across the board.  I think the future as far as Microsoft is concerned is WPF and it will just get better and better over time.  The Winforms, while my personal favorite, will most likely go the way of the dodo bird.  Right now our WPF version is not as fast as our Winforms by quite a lot on some limited things however I think WPF will get the most speedup across the board. 
  
 David

Thanks for the answers.  I think I’ll stick with WPF.   
  
 I was able to load and render 5 sql server layers containing about 250 features total in about .7 seconds. 
  
 I was able to reduce that by using the GeoCache of the FeatureSource to .07 seconds using the same data. 
  
 sql2008Layer.FeatureSource.GeoCache.IsActive = true; 
  
 I just need to keep in mind to disable the cache when updating an object, clear the cache, refresh from sql server, and then turn the cache back on.   
  
 It really runs fast now.  The more improvements the better though.

I shoud mention that the first time it loaded when the app started, the render time was still .7 but after that when panning or zooming it became .07.

Peter, 



Good news.  The Geocache for me is a mixed bag and we want to improve is a bunch more in the future.  It has some weaknesses but most of them are for high density layers in the 10,000 features or more range.  The issue is that under some circumstances it will cause the map to draw extra stuff that it does not need to.  The trade-off is that you don't have to go back to SQL which can take a long time.  I think in the near future we can come up with a way to minimize the issue with the items to draw and support the large number of feature cases. 



David



Can you give me a code sample of how to pre-generate tiles?

Peter, 
  
   Would you mind posting this as another topic? 
  
 David

No problem.

Thanks,Peter & David. 
  
 Yale