[Gambas-user] about combobox

Benoit Minisini gambas at ...1...
Sun Aug 31 16:15:33 CEST 2008


On vendredi 29 août 2008, Benoit Minisini wrote:
> On mardi 26 août 2008, Fox wrote:
> > About combobox, we are talking about this control a little time ago.
> > There is a big difference from QT and GTK combobox.
> > Gtk combobox have trouble to manage long lists, try to fill with many
> > items, it make load for time and also you have trouble to search what
> > you need.
> >
> > QT combobox is not fast, is better, and also, when you have many items
> > you can find what you need very quickly because you can type the start
> > characters of you matching word.
> >
> >
> > I'm on a Debian sid 64b
> > Gambas 2.7
>
> Are you talking about read-only combo-boxes or read/write combo-boxes?
>
> The implementation of GTK+ combo-box is not really optimal: can you detail
> what is slow exactly? With some code, or, better, a full project.
>
> Regards,

I have committed a gb.gtk ComboBox patch in revision 1530.

Here is some little benchmarks on my Dual Core.


1) Before the patch.

Filling a combo-box with 1000 items:               0.474  s
Then reading the Count property 100000 times:     15.650  s

Filling a sorted combo-box with 1000 items:      170.95   s
Then reading the Count property 100000 times:     18.43   s


2) After the patch.

Filling a combo-box with 1000 items:               0.0125 s
Then reading the Count property 100000 times:      0.0162 s

Filling a sorted combo-box with 1000 items:        0.0224 s
Then reading the Count property 100000 times:      0.0164 s


3) Same thing with the gb.qt component.

Filling a combo-box with 1000 items:               0.0014 s
Then reading the Count property 100000 times:      0.0157 s

Filling a sorted combo-box with 1000 items:        2.782  s
Then reading the Count property 100000 times:      0.0169 s


The patch tries to delay all heavy GTK+ process as much as possible when 
adding items. If I did not make any bug, other properties and methods should 
work as expected.

gb.qt is still the fastest, except when the combo-box is sorted. But maybe I 
can do the same optimization there than I did in gb.gtk.

And searching is not possible yet.

Regards,

-- 
Benoit Minisini




More information about the User mailing list