ThinkGeo.com    |     Documentation    |     Premium Support

Performance issues with dynamically-updated image

Hi,


I'm trying to move an image on a raster map and found some perfomance issues with my code. The map image is a 10000x7000x8bpp BMP and the image I want to move is 48x48. The C# code is attached to this message.


Regarding the performance, when I look at the map at full zoom out, the CPU usage is about 20%. When I'm zooming it goes up to 30-40% . I tried to disable the map refresh - wpfMap1.Refresh(wpfMap1.Overlays["PlaneOverlay"]);, and the CPU usage became 0%.


How can I improve the perfomance of my application?



1320-Window1.xaml.cs (3.56 KB)

Uri, 
  
   Would it be possible do you to send us the bmp file?  We could arrange for you to drop it somewhere.  What screen resolution are you running and about how big is the map window?  My initial guess is it has to do with the very large bitmap.  Many times when people have large images like that they are in ECW or MrSid compressed files.  This help allow with refreshing.  What is the time if you turn off the big bitmap behind?  We will need to re-create it.  What are the specs on your machine just to get an idea of what you are running? 
  
 David

Hi David,

Thanks for your response.



Here's a link to the map image: rcpt.yousendit.com/756288695/82b91d2ac04130d5ce4d9222db934929

I tried converting to ECW but that didn't seem to make any difference.



Regarding the screen and window sizes, screen is 1680x1050 and the window is 740x528.



If I turn off the large bitmap the CPU usage is usually ~15%, with peaks when I perform zoom or drag operations.



System specs -

CPU: Core 2 Duo 2.33GHz

Memory: 4GB

Video adapter: NVidia GeForce 8800 512MB

OS: Windows XP SP2

.NET framework: 3.5 SP1



Thanks,

Uri



Uri, 
  
 Could you verify your link and make sure it can access? We can not recreate your problem without that image. 
 And also could you test your program by using our Ecw file at C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 3.0\Samples\SampleData\Data\World.ecw 
 instead of yours, then tell us is it has performance issue too. 
  
 Thanks. 
 James

Uri, 
  
 Your link is working, I can download the image now. I can’t access the link because my IP is blocked by my service provider, I change another IP address it works. 
  
 But I still can not recreate your performance issue, I can see the little icon move regularly. 
  
 Test system specs- 
 CPU: Core 2 Q6600 2.40GHz 
 Memory: 4GB 
 Video adapter: NVidia GeForce 8500 GT 
 OS: Windows 7 build7100 
 .NET framework: 3.5 SP1 
  
 Thanks. 
 James 


Hello James, 
  
 The problem was not that the icon didn’t move, it’s that the CPU usage is increasing rapidly - from about zero to more than 15-20% 
 This is disturbing since my requirements are to have much more than one dynamic annotation moving on the map, plus some more processes running simultaneously. 
  
 Thanks, 
 Uri

Uri, 
  
 I am sorry that Wpf has this performance issue, it can not avoid that CPU usage is high so far.  
  
 I have modified the code which you supplied and add more point to test, I found that if the count of points is less than 100, the cpu usage will keep at a normal range, but if more than 100, it will increase as much as the count. We have a sample called “RefreshPointsRandomly” in HowDoI samples, you can look at what it did, and most of users can accept the performance like that. 
  
 We will try to make wpf better in the future, if we complete I will let you know. 
  
 Thanks. 
  
 James