[Kde-pim] Problem with bulk fetching of items with 4.8

Kevin Krammer kevin.krammer at gmx.at
Sat Feb 4 16:15:19 GMT 2012


Hi Shaheed,

sorry for not replying earlier.

On Wednesday, 2012-02-01, Shaheed Haque wrote:
> With the hints provided, I now have something reasonably functionally
> clean in SVN. Unfortunately, the performance is a bit poor in the
> sense that I can fetch 300 items from Exchange in around 1000 ms, but
> it then takes me ~60,000 ms to store in Akonadi. Now, given that I'm
> writing one item at a time to Akonadi, the obvious thought is that it
> would be better to run all the writes within the context of a
> transaction, and use a single commit() at the end (as per the model I
> started this design with). However, I cannot make that work...
> 
> Basically, that approach seemed to work in the early stages when I
> simply used ItemCreateJob on each item, but (somewhat to my surprise),
> I found that creating the same object twice (i.e. with the same
> remoteId) resulted in two objects being created. So, I end up trying
> to ItemFetchJob first and depending on the success or failure,
> ItemModifyJob or ItemCreateJob.

The maildir resource's retrieveitemsjob basically uses the same approach.
However, I think it first fetches all current items and the compares to that 
job's result when processing the remote items.

> At this point, I'm a bit unclear what options I have. I *think* I'd
> like to be able to do whatever it is that ItemsRetrievedIncremental()
> does...

The ResourceBase's implementation for retrieve items methods use a special job 
class called ItemSync.
It is more or less a transaction of item create, modify and delete jobs based 
on comparison with the result of prior item fetch.
I think it is actually a public class.

Maildir resources uses a different implementation because timestamp information 
on its backend (maildir files) allow it to only process a subset of backend 
items.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120204/a28007cd/attachment.sig>
-------------- next part --------------
_______________________________________________
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