Re: [OpenMap Users] Optimizing Performance

From: Ruben DF <rdocasalf_at_gmail.com>
Date: Mon, 6 Jun 2011 17:49:21 +0200

Hi Rob,

2011/5/23 Rob Ratcliff <rratcliff_at_ticom-geo.com>

> 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.
>

I agree with you. I have a dedicated thread for all layers


>
> 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.)
>

Yes, I use a BufferedImageRenderPolicy for my static layers I must admit the
app goes quite better...


>
> 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
>

To be honest, I have not noticed any improvement adding these parameters,
thanks anyway :)


>
> 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 Jun 06 2011 - 11:49:39 EDT

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