[Kstars-devel] Performance of KStars Lite

Akarsh Simha akarshsimha at gmail.com
Sat Jun 4 22:54:03 UTC 2016


Dear Artem

> While porting lines (Equator, EquatorialCoordinateGrid,
> HorizontalCoordinateGrid,
> ConstellationLines etc.) I noticed that performance of Android version fell
> down pretty significant. Profiler shows that sincos is called a lot and at
> least on my tablet this causes very laggy slewing.

What projections are you supporting in the Android version? Given that
these arcs are circles, it might be possible to project them
analytically and find what curve they correspond to on the projection.
This might or might not be easy and might or might not improve
performance.

> I thought that we could use SkyMesh to see what lines have to be updated and
> call toScreenVec accordingly but it turns out that SkyMesh doesn't always
> return visible Trixels correctly. I'm doing the following:
>
> Call SkyMesh::aperture(focus, radius)
> Iterate over visible trixels with MeshIterator region (mesh,DRAW_BUF);
>
> On minimum zoom when the whole half sphere is visible I get all 512 trixels.
> I thought that in this case it has to be around 256 trixels. Also when I
> don't draw lines based on what trixels are visible, some of lines in visible
> area are not drawn. Is it a normal behavior or a bug?

I'm not extremely familiar with HTMesh, it might be a good idea to
contact James Bowlin. I think you are right that it should return only
256 trixels. I'm not sure why it might be normal behavior to return
512. Maybe you should also check what radius it is calling aperture
with, and look into the implementation of aperture() -- it might be
the case that radius is not really a proper arc-length on a sphere,
and so it doesn't work very well when radius is large.

> Is it possible to minimize the number of calls to Projector::toScreenVec()?
> Can we modify Projector::checkVisibility() so that we don't call
> toScreenVec() if we now that the SkyPoint is not visible?

I thought this was already done. If it's not, you might want to do a
git blame and see the relevant commit logs. Equirectangular projection
is special in that it can allow you to see both hemispheres
simultaneously, and we like to allow for this to happen in KStars.

Here is one more pointer, not sure if it is already done in the code:
You can reduce the resolution of the lines at low zoom, and increase
the resolution at high zoom. This way, at low zoom, you have few
points because of the reduced resolution. At high zoom, you have few
points because only the visible trixels are relevant.

> I committed all the changes so feel free to test them on your device and
> measure the performance. Also, if someone has experience with shaders I
> would appreciate helping me as Qt Quick Scene Graph doesn't support drawing
> dashed lines out of a box and I would like to use shaders for that but have
> a few questions.

Questions regarding Qt Quick -- you might get a lot of help on the
kde-devel IRC channel or the kde-devel mailing list.

Regards
Akarsh


More information about the Kstars-devel mailing list