[Kbabel] kbabeldict bottleneck

Andrea Rizzi rizzi@kde.org
Sat, 1 Mar 2003 23:53:22 +0100


Hi,
there is a speed bottleneck in kbabeldict

each time a searchengine emits 
resultFind(SearchResult *)
kbabeldict add it to the listview (and this is ok :-))

The problem is that the slot addResult is too slow!!!

It  want to keep the position of listview selected item
"costant" (see kbabeldictbox.cpp  ::addResult ),  to do that it save
the index, add the new result and then it calls
itemAtIndex(saved index)
this is the slower function in the world if you put about 100 entries in the 
list.
I also think we do not need it, a listview is a List so we do not need that 
index based keeping, the pointer is enough.
I think we should remove all that code...

Bye
Andrea