[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Do TreeIters persist after foreach search ?
- From: "muppet" <scott asofyet org>
- To: gtk-perl-list gnome org
- Subject: Re: Do TreeIters persist after foreach search ?
- Date: Thu, 8 Nov 2007 09:43:32 -0500 (EST)
Dave Howorth wrote:
> Emmanuele Bassi wrote:
>> $iter = $model->get_iter($match_path); # always check retval
>
> I was trying to avoid this because I think it must do a second tree walk
> to reach the node? Which shouldn't be necessary.
It's not a full walk of the tree, so it's not heinously expensive, but you are
correct that it is not free.
> But I've switched to this technique at the moment unless anybody can
> suggest anything better.
See my other post in this thread. (I should've read the whole thread before
replying...)
> At the moment the search is way too slow. I'm just about to profile it
> to see whether I can fix it or whether I need to do my main tree
> handling outside of the gtk tree model and just use the gtk model as a
> display slave.
That path often leads to madness involving dual-data-structure synchronization
and memory wastage. You may wish to investigate creating your own TreeModel
implementation in that case, so that the TreeView will effectively display
your native data structure.
> I guess another alternative might be to reimplement foreach's tree walk
> myself which would lose the function call overhead and will probably
> avoid whatever weirdness is messing with the stamp.
I doubt that would save much, honestly.
--
muppet <scott at asofyet dot org>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]