[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    Re: [Kstars-devel] Note on drawing speed
From:       Luciano Montanaro <mikelima () cirulla ! net>
Date:       2010-03-10 17:12:39
Message-ID: b2289f81003100912j777339b7ne04aa58ba133b10b () mail ! gmail ! com
[Download RAW message or body]

On Wed, Mar 10, 2010 at 6:01 PM, Luciano Montanaro <mikelima@cirulla.net> wrote:
> On Wed, Mar 10, 2010 at 4:22 PM, Khudyakov Alexey
> <alexey.skladnoy@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
_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic