[Kde-pim] Review Request: Optimize file access in maildir

Andras Mantia amantia at kde.org
Sat Feb 11 19:20:23 GMT 2012


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

Review request for KDEPIM and Kevin Krammer.


Description
-------

This patch reduces the number of file stats (QFile::exist) in the maildir library by caching the content of the cur/new directory listing and using QMap lookup to search for file existance.
The patch also optimizes the mapping between collections and Maildir objects in the resource.


Diffs
-----

  resources/maildir/libmaildir/maildir.cpp d61ac0b 
  resources/maildir/maildirresource.h 233732c 
  resources/maildir/maildirresource.cpp b5aa3e2 
  resources/maildir/retrieveitemsjob.h dfc7095 
  resources/maildir/retrieveitemsjob.cpp 97f22b3 

Diff: http://git.reviewboard.kde.org/r/103947/diff/


Testing
-------

1) make test in libmaildir passes
2) I run a variant of the patch for quite some time (~2 months) without problem. The only difference was using a QStringList instead of QMap for caching, which make the code even slower. :)
3) You can see the poor man's profiling with the QTime: with a 18K folder subsequent synching (when nothing changes, just click on the folder in KMail that triggers a sync), is around 1100ms. With the patch it is around 670ms. With a 30K folder it was above 2000ms, now it is below 1200ms. This is the time for "ENTRIESPROCESSED", the actual amount of time needed to compare the items in the database with the files on the disk.


Thanks,

Andras Mantia

_______________________________________________
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