Re: [OpenMap Users] Optimizing Performance

From: Ruben DF <rdocasalf_at_gmail.com>
Date: Mon, 6 Jun 2011 18:39:48 +0200

Hi Don,

2011/5/23 Don Dietrick <dfdietrick_at_gmail.com>

> Hi Ruben,
>
> All of the suggestions posted are excellent, but Jesper points a key
> question. I know you say that 40ms repaint is a requirement, but why?
> Are you tracking things that are moving? How many? Updating at that
> rate will involve a lot of rendering for very little payoff - zoomed
> out maps will have objects barely moving at that frame rate unless
> they are moving very fast, but even then it would be hard to see
> changes at that rate.


That's true, I'm going to write a code where rate will be decreased when
zoom is out and in the opposite way.


> You might want to check to see if the map
> location of your objects have changed before deciding to repaint,
> instead of checking whether the objects have moved geospatially.


I'm afraid I don't understand this...what is the difference between checking
whether the objets have moved geospatially or checking whether have changed
their map location??


> If
> you are changing how things look (vibrating map objects to highlight
> them, changing their color, etc), I can understand why you would want
> the update rate to be something higher. In that case, you might want
> to buffer several maps together with different rendering parameters,
> and then loop that set.
>

I think the problem is on a layer which contains the trace of the plains,
i.e, contains a set of OMPoints which is growing each second (36 points are
created per second, so after 10 minutes, there are more than 20000 points
and cpu is collapsed). I generate only the 36 new points which are created
per second, but I have a problem on the render method, since I need to
render all of them if I want to see them on the map...is it possible to make
a layer and set Background as true and only render the last point? If
backgroud is true there are no movement (only when zoom or pan since
projectionchanged() is called) and right now I must render all the points to
see them on the map...

I've made a method to erase part of the trace each minute since if I don't
do that, cpu usage percentage is quite high.

I'm goint to create layers of 100 points as maximum and when they are full
(100 points) I will set them as background and other new layer will be
created to contains the next 100 points and so on... (in order to render
only 100 points as maximum). I don't know if this can solve my problem...I
will tell you :)

Thanks in advance,
Greetings

Ruben


>
> - Don
>
> On Mon, May 23, 2011 at 7:25 AM, Jesper Berglund
> <jesper.berglund_at_pertexo.se> 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"]
> >
>


--
[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 - 12:40:51 EDT

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