Re: [OpenMap Users] Optimizing Performance

From: Rob Ratcliff <rratcliff_at_ticom-geo.com>
Date: Mon, 23 May 2011 08:25:58 -0500

Coalescing the repaints with a Swing timer as Jesper mentioned is a very effective way to reduce CPU usage and clogging of the EDT.
Its best to use one timer for all layers to avoid multiple repaints caused by multiple timers.

Another thing you can do is to use the "BufferedImageRenderPolicy" for layers which require lots of vector drawing such as the VPF
(coastlines) layers. This policy will only redraw this background layer when the zoom or pan changes and otherwise just draws the
cached off-screen image.

I'd also find out which layers is taking the most time to paint and start optimizing that layer. An easy way to do that is monitor
CPU usage while you turn off each layer while the application is under load. (We found that the VPF layer was one of the slowest
drawing layers and using the BufferedImageRenderPolicy had a huge performance benefit.)

Also, if you running remotely over X, you might try adding JVM parameters:

-Dsun.java2d.pmoffscreen=false (or true depending on the X server)

and experimenting with:
setenv J2D_PIXMAPS server|shared

and get rid of translucent colors to avoid sending bitmaps over the network and use polyline draws rather than multiple draw line
calls to reduce X-server load.

Rob


On 05/23/2011 06:25 AM, Jesper Berglund wrote:
> Has the map changed during the 40ms, like panning or zooming?
> Is there objects on the map which has changed?
>
> Don't repaint all layers, only those who might have changed.
>
> Repaint only on changes of data.
>
> If there is a burst of events, coalesce during a timeperiod and then repaint using javax.swing.Timer .
>
> These are the measures that I have made in my Openmap app.
>
> HTH
>
> /Jesper
>
> Ruben DF skrev 2011-05-23 11:30:
>> Hi,
>>
>> I'm afraid I cannot repaint each 500 ms or longer...it's a customer's requirement... :(
>>
>> Thanks anyway!
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon May 23 2011 - 09:28:51 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT