[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: fast compacting folder - tips
From: Philippe Fremy <fremy () yalbi ! com>
Date: 2001-02-10 21:13:46
[Download RAW message or body]
> > 3. fread the messages until this message
> > 4. skip the deleted msg, store its size
> > 5. for the next messages you read, substract the deleted message size
> > to the offset in the index
> > 6. goto step 2.
> >
> > When the buffer is full, fwrite it at once.
>
> Very well. :-)
>
> Some comments:
>
> a) please assure that messages / folder indexes do not become invalid by
> moving the messages in this fast way
You are just compacting. The best way to do it ensuring data integrity is
how it is currently done : create a _new_ folder, do everything and then
remove the old folder and rename the new one.
> b) if you use mmap() instead of fopen / fread, you will gain an extra
> speedup that is IMO worth the work.
Given that my trash folder use to be 117 Mo big, I don't know if it is
desired :-)
> c) I do not think that the buffer needs to be very big. In the current
> code most time is lost when the messages are parsed by mimelib. Skipping
> this step should already help (correct me if this is already done).
Yeah. But first someone has to do it, then we will discuss how it can be
improved.
PHilippe
_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic