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

Andras Mantia amantia at kde.org
Sat Feb 11 19:36:10 GMT 2012



> On Feb. 11, 2012, 7:30 p.m., Milian Wolff wrote:
> > resources/maildir/libmaildir/maildir.cpp, line 183
> > <http://git.reviewboard.kde.org/r/103947/diff/1/?file=49284#file49284line183>
> >
> >     why a hash? when is the bool value ever set to false? am I missing it?
> >     
> >     if not: use QSet

Ah, I used a QSet, then realized I might need to convert it to a QStringList, so I switched to QHash. But as my "might" was not true, I can make it a QSet again.


> On Feb. 11, 2012, 7:30 p.m., Milian Wolff wrote:
> > resources/maildir/retrieveitemsjob.h, line 28
> > <http://git.reviewboard.kde.org/r/103947/diff/1/?file=49287#file49287line28>
> >
> >     probably unrelated debug stuff

Deliberately left there to see what I was meassuring.


- Andras


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


On Feb. 11, 2012, 7:20 p.m., Andras Mantia wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103947/
> -----------------------------------------------------------
> 
> (Updated Feb. 11, 2012, 7:20 p.m.)
> 
> 
> 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