Complete.Org: Mailing Lists: Archives: offlineimap: September 2008:
Re: Darwin patches
Home

Re: Darwin patches

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: Re: Darwin patches
From: Michael Witten <mfwitten@xxxxxxx>
Date: Sat, 27 Sep 2008 22:14:15 -0500

On 26 Sep 2008, at 10:43 AM, Michael Witten wrote:

> Frankly, the original code doesn't even make much sense, and
> moreover it's not forward compatible with python 2.6, and
> furthermore:
>
>   DeprecationWarning: socket.ssl() is deprecated.
>
> So, this commit is just a temporary fix.

I see that recently the following patch was included:

> diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py
> index 4c89cca..b0830c7 100644
> --- a/offlineimap/imapserver.py
> +++ b/offlineimap/imapserver.py
> ...
> +    # This is a hack around Darwin's implementation of realloc()  
> (which
> +    # Python uses inside the socket code). On Darwin, we split the
> +    # message into 100k chunks, which should be small enough -  
> smaller
> +    # might start seriously hurting performance ...
>
> +                data = imaplib.IMAP4.read (self, min(size-read,8192))
> ..
> +                data = imaplibutil.WrappedIMAP4_SSL.read (self,  
> min(size-read,8192))

This particular problem is fixed in python 2.6, and they use:

> read(min(size-read, 16384))

Because this is going to be fixed at a fundamental level, maybe you
should include some kind of warning message at program start, so that
we can remember to remove this special treatment later.

Also, you guys seem to be wasting a lot of cycles every read():

> if (system() == 'Darwin') and (size>0) :

Shouldn't that information be cached somewhere? Why not bind 'read' to
a particular implementation at program startup, so that there is  
virtually
no overhead.

Sincerely,
Michael Witten




[Prev in Thread] Current Thread [Next in Thread]