[Kstars-devel] Note on drawing speed

Luciano Montanaro mikelima at cirulla.net
Wed Mar 10 18:12:39 CET 2010


On Wed, Mar 10, 2010 at 6:01 PM, Luciano Montanaro <mikelima at cirulla.net> wrote:
> On Wed, Mar 10, 2010 at 4:22 PM, Khudyakov Alexey
> <alexey.skladnoy at gmail.com> wrote:
>> Hello
>>
>> It's well known that drawing of sky map in kstars is way too slow. Recently I
>> identified one of bottlenecks. At low zoom about a half of time is spent in
>> drawing constellation boundaries and coordinate grid. Almost all that time is
>> spent in QPaint::drawLine and number of calls is very big.
>>
>
> It looks like there are further opportunities to optimize, but a first
> step would be by
> filling an array of coordinates and calling drawLines()  instead of
> using a loop around
> drawLine(). Maybe Qt does some coalescing, but there are expensive
> operations that
> are repeated for each drawLine() call that only need to be done once.
>

Sorry, I meant drawPolyline(). drawLines would work, but
drawPolyLine() in this case would be better - you need a smaller
array. I suspect just this change would be a great improvement. I
remember advices about using this kind of calls over single primitive
ones even at the X11 level.

-- 
Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams


More information about the Kstars-devel mailing list