[PyKDE] Custom sorting function for the QListView widget

Fernando Jorge Silveira Filho fernando at land.ufrj.br
Sun Jul 4 01:03:01 BST 2004


Hi,

I've tried your suggestion and it does indeed seem to show an increase 
in performance. I've measured it as being around 10% of improvement for 
a large dataset (10000 records on the listview). My datasets will 
probabibly be around 1000 records, and at that level the difference 
doesn't seem very noticeable. It takes around 4 seconds on my machine to 
sort the list, and even though it may sound a little bit too demanding 
from me but I think I will probably have a much better result by 
implementing it directly on C++. I was betting on Python for the 
simplicity, but I believe I really hit a soft spot this time.

Do you know how Python delivers its functions to the C++ interface? I 
mean in this case, would it be justifiable to believe most of the 
performance hit comes from the fact that the C++ QListView sorting 
routine has to call a function that is being run on the Python virtual 
machine a number O(n * log n ) times? Would this incur in a boundry 
cross? If this is the case, I am pretty confident that the solution 
should be heading for C++ in this one.

Thanks for all your help Troy.
Fernando




More information about the PyQt mailing list