Re: [gtkmm] Custom TreeStore Problems
- From: Christof Petig <christof petig-baender de>
- To: Christer Palm <palm nogui se>, Murray Cumming Comneon com
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] Custom TreeStore Problems
- Date: Thu, 16 Oct 2003 08:57:13 +0200
Christer Palm schrieb:
Just curios - how do you perform a binary search when there's only a
forward_iterator? Isn't that in fact pretty much the root to the
TreeModel performance problems in general?
I guess you are right here: I suspect std::lower_bound determines that
TreeStore::iterator is a sequential access iterator and emulates binary
search by skipping elements (if increment is much cheaper than
comparison this is a reasonable move). Of course this assertion does not
hold for trees (which is why they usually implement lower_bound as a
more efficient member function). I did not try whether linear search
might be faster (my custom model is _much_ (10x at 10k) faster).
I still have no clue why this did not show up more cleanly in profiling
(the call numbers were high but time seemed to be spent elsewhere).
-----
So, to Murray: Do you see that there is Value to a custom TreeModel in
this case? Another example might be a model where column contents
interact with each other (e.g. Color is dependant on text content).
-----
But ... this does not yet explain the problem mentioned on the
gtk-app-devel list (see my previous post for the source). He did only
append.
Christof
PS: My custom TreeModel example at
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/*checkout*/manuproc/Komponenten/examples/owntreemodel.cc?rev=HEAD&content-type=text/plain
performs well while calculating about 4G rows. (does not depend on
anything else but gtkmm)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]