Hi,

I have also been experiencing performance issues with TreeView (see posting by me on 26 Feb re: TreeModelFilter performance).

Generally, I don't think the TreeView has been tested much with models containing more than a few thousand rows, and once you get above this you can hit some ugly performance problems, depending on what you are doing.

Some things you can do to improve performance:
  • set_fixed_height_mode
  • use fixed with columns in the view
  • use your own custom tree_model.
The first two stop the treeview doing lots of size calculations and can speed things up dramatically.

Using a custom tree model I was able to get good performance up to about 200,000 rows for a viewer for HDF5 files (see pytables for more on HDF5).   By having my own model I did not need to load the data until the view asked for it which was a big win for me.

Unfortunately, as my model grows there is a (linear) hit as the view is initialised.  I looked at the gtk code and discovered the view builds its own rb_tree with an entry ready for each row in the model + building this tree was taking about 5 seconds when I had 350K rows :(

I don't think fixing this in the 10K lines of code for gtktreeview.c would be easy.

Instead, I've been working on a viewer where the TreeView itself never has more than 1000 rows.   I replace the scrollbar with my own scrollbar,  intercept all the movement events through the data and do my own buffering of the data to the treeview.      

The code is very much a work-in-progress at the moment + needs a fair bit more work.   As soon as I have a basic working demo I will post it to the list.    Note that I am only working with the case where I have a simple (but large) set of records to view -- ie my tree has depth 1, or if you prefer my store is a ListStore.

Finally, I'm not entirely sure whether your performance issues are a variation on what I am running into.  Can you post a simple code snippet?   How many rows can you put in your tables before the performance starts to fall off?    If your TreeViews are really listviews and your performance is good up to 500 or so rows then you might find the approach I am working on will help significantly.

John

Frederico Arnoldi wrote:
[pygtk] Treeview speed is a algorithm or hardware problem?

Hi All.
I have been working in a tool that display large sequences of data. Using
normal text it work's fine, but when I substitute the normal text by markup
text it get to slow. I have already tried set_fixed_height_mode, but didn't
work. Is it an algorithm  or a processor/RAM memory problem?
Is there another way to improve the treeview performance?

Thanks
Fred

_________________________________________________________________
Chegou o que faltava: MSN Acesso Grátis. Instale Já!
http://www.msn.com.br/discador

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to