[Kde-pim] Review Request: Improve search peformance

Kevin Krammer kevin.krammer at gmx.at
Wed May 20 21:07:22 BST 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/730/
-----------------------------------------------------------

(Updated 2009-05-20 13:07:22.467320)


Review request for KDE PIM and Tobias Koenig.


Changes
-------

Excellent suggestion Ingo!

I modified the getter functions to also take the field instance so I could do a similar getter for fields with only one value.
This as the advantage of not having to do any conditional branch in the inner loop, each field is treated equally.

Time is now again like it was before the change to support fields with list of values :)


Summary
-------

The change to search all values of fields has resulted in a major slowdown of SearchManager::search().

The elseif string comparison chain is quite obviously the main factor of that, so this patch replaces it with a QHash lookup which maps the label to an appropriate function pointer for getting the field's values.


Diffs (updated)
-----

  /trunk/KDE/kdepim/kaddressbook/searchmanager.h 970790 
  /trunk/KDE/kdepim/kaddressbook/searchmanager.cpp 970790 

Diff: http://reviewboard.kde.org/r/730/diff


Testing
-------

Primitive benchmarking using QTime::elapsed() indicates the new code is about 10 to 20 times faster, but still quite slower than the original code.


Thanks,

Kevin

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list