[Kstars-devel] profiling KStars

Luciano Montanaro mikelima at cirulla.net
Wed May 24 15:34:29 CEST 2006


On Wednesday 24 May 2006 14:37, Jason Harris wrote:
> Hi,
>
> Luciano Montanaro wrote:
> > Well, the two approaches could be pursued independently, and could both
> > help. Even a coarse subdivision would reduce the number of objects to
> > check.
> >
> > For the three-D approach, you could go even further than that, you
> > could directly use an OpenGL widget to do the rendering.
> >
> > You would probably use homogeneous coordinates in this case, with 4
> > values (the fourth being zero, indicating the point is at infinity).
> >
> > Luciano
>
> Yes, the two ideas I talked about are independent.
>
> We actually had a port of KStars-3.x to openGL implemented by an
> interested user.  It worked, but one problem with openGL (IIUC) is that
> it's difficult to dynamically change the list of objects being rendered.
>   This is an issue for dynamic visibility as a function of zoom level,
> and preventing the stars from getting larger as you zoom in (both of
> which we do in KStars).  I suppose these are not insurmountable issues
> in openGL.
>
> Besides, I don't want to make openGL a dependency, so we still need fast
> rendering without it.  Maybe later on we can take another look at openGL.
>
> Jason

I have not looked at the code, so maybe I'm writing about things already 
implemented.

Let's put aside the OpenGL rendering, even if that could be an option, 
eventually.

Do you have only one big list of stars? Because one way to skip unneeded 
checks would be to have one list for magnitude step, and render all the 
lists (vectors) which are of the needed magnitude. This could be useful 
also when the user is moving around the view, we could start showing the 
brighter stars, then the magnitude 2 stars, and so on until we have shown 
all of them, or a redraw event arrived. 

As for the mesh partitioning, something simpler to do could be to sort the 
stars by longitude and latitudede, and find the minimum and maximum 
longitude the view can show. If we keep a vector of pointers (or indices) 
to stars for each degree (say), we could remove at least half the stars 
from being checked, and much more at higher magnification. Actually, 
knowing the maximum and minimum latitude the view contains, we'd still have 
to iterate over the stars in the shown range of longitudes, but we can skip 
the stars outside the latitude range. This will not be too great when the 
view contains one pole, though.

Luciano
  

-- 
Łŭčīåñø Montanaro //
              \\ //
               \x/ www.cirulla.net


More information about the Kstars-devel mailing list