[Lazarus] Cairo library usage

Luiz Americo Pereira Camara luizmed at oi.com.br
Sat May 17 17:32:18 CEST 2008


Mattias Gaertner wrote:
> On Sat, 17 May 2008 08:45:39 -0300
> Luiz Americo Pereira Camara <luizmed at oi.com.br> wrote:
>
>   
>> Some facts:
>>  - LCL-gtk2 applications are slower than gtk2 pure applications
>>     
>
> What did you measure? 

See below.

> How much? 
>
>   
There's no synthetic benchmark, just the gtk2 apps feels more responsive.
Also LCL-Gtk2 applications flickers a lot unlike other gtk2 application 
in the same system

>>  - LCL does not use cairo directly to draw, it uses gdk
>>  - Gdk is faster than cairo
>>  - Gtk2 internally still uses gdk in most places
>>
>> So assuming cairo is used a lot by gtk2 this could explain why Gtk2
>> is slower than Gtk1 but not that LCL-Gtk2 is slower than Gtk2.
>>
>> Things to look when optimizing LCL-Gtk2:
>>
>>  - Pango (FontConfig is called a lot in LCL-Gtk2 applications)
>>     
>
> How do you know?
>
>   

Some time ago, I profiled gtk2 pure/LCL-gtk2 applications with valgrind 
and found excess of FontConfig calls in LCL-gtk2.
Not sure how is today, after recent changes done in LCL trying to cache 
pango objects.

>>  - Double buffer is disabled
>>     
>
> What controls?
>   

All?

It was already related in the mail list. Search for a thread "Lazarus 
v0.9.25 r13078M with gtk 2"

>  
>   
>> If the LCL devels agree in one week i can provide a complete
>> separated Gtk2 interface so the changes to get LCL-Gtk2 faster can be
>> done easily and without breaking gtk1
>>     
>
> What do you mean with 'complete separated Gtk2 interface'?
>
>   

See another post

Luiz



More information about the Lazarus mailing list