Re: gtk_tree_view so slow



Kristian Rietveld wrote:
On Wed, 2003-08-27 at 08:58, Maxim Reznik wrote:

The problem I encountered is gtk_tree_view scans
whole tree_model when I create the form.
That's the validation step, where all rows are being measured.

It takes too much time if there are many rows in table.
Yes, it does for tables with more than 10000 rows.
Even worse. It takes about 6 seconds for 1000 rows.
Under M$ Windows it takes longer (23 sec).
By the way why gtk_tree_view slower under M$ Windows?
It seems it very depend on number of collumn in the table.
Table with 16 columns is so heavy to scroll.



Is there a way to prevent such full scan?
There will be a way to "disable" validation in gtk+ 2.4, which will
prevent a full scan. Until then there's not much you can do.

I considered follow ways to speed up:

1) I found gtk_tree_view_build_tree where there is loop over all rows.
I make my gtk_tree_model_iter_next trivial. It just increment row index.
All real job for positioning in the table is done in get_value.
It doesn't help much perhaps because of validation phase.

2) Next I realised get_value is called for each cell in table.
I thought I could manage it by pretending there are only 30 rows in the
table. Then I waited while user scroll down to the last row and
emitted "insert_row" signal for next 30 rows.

It doesn't help either. I think it's because validation calls
get_value(column=1, row=30) triggering my "insert_row" signal.
Singnal then triggers next validation process. And so on.

Is there a way to distinguish validation process from user
scrolling?
Could I rely on fact than first call get_value(column=1, row=30) is
validation phase and all next is visualization?

Is there any other tricky way to speed up before 2.4 version is out?



        -Kris
Thank you Kris very much for your help.

Maxim

PS Excuse me pure English.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]