Re: [Evolution-hackers] ... and how camel should be



On Tue, 2006-02-14 at 19:40 +0100, Philip Van Hoof wrote:
> On Tue, 2006-02-14 at 13:02 -0500, Lee Revell wrote:
> > On Tue, 2006-02-14 at 18:57 +0100, Philip Van Hoof wrote:
> > 
> > I really don't think the message IDs are the main source of bloat in
> > Evo.
> 
> I measured it ;-)
> 
> 10.000 E-mails used +-8MB of memory.
> 
> This is how I quickly measured it.
> 
> gint s=0;
> 
> static void measure (gpointer data, gpointer user_data)
> {
> 	s += strlen ((const char*)data);
> }
> 
> GPtrArray *uids = camel_folder_get_uids (folder);
> g_ptr_array_foreach (uids, measure, NULL);
> g_print ("%d\n", s);
> 
> Luckily the format of those message ids is a small string version of the
> follow-up number. So "0","1", "2", .. "9999". So it's a lot small
> strings. Which is of course better then a lot "message-id" headers
> 
> But if it's a follow-up, I wonder why not simply return the total amount
> of messages in a folder, and let the developer use a simple loop like:
> 
> for (i=0; i<that_length; i++)
> {
> 	msg = camel_ folder_get_message_info (folder, i);
> }

we don't do that because the uids are not necessarily contiguous. You
might have "1", "3", "4", "5", "7", "109", "110"

Refer to the IMAP specification for further info on how UIDs work. Hint:
They are NOT message-ids nor are the sequence-ids.

-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]