<<< Date Index >>>     <<< Thread Index >>>

Resyncing a 40k folder generates 380k mail_addr_is_user calls for 5mn (try 3)



[mmmh, my mails still look like they're randomly getting eaten. Trying one
more time]

On Wed, Mar 28, 2007 at 12:02:33AM +0200, Vincent Lefevre wrote:
> On 2007-03-27 08:33:27 -0700, Marc MERLIN wrote:
> > However, if the parent directory of the folder I'm viewing, gets
> > modified (let's say I'm in ~/Maildir/.snd/ and I send a new mail),
> > mutt takes a silly time to resync the folder, like 4mn for 40,000
> > messages.
> 
> That's probably the bug I reported here:
> 
>   http://bugs.mutt.org/1931
> 
> (I don't use the header cache).

I don't think that's it.

When I open my 40,000 message Sent folder, it takes maybe 5sec.

after opening mutt:
magic:~$ wc -l .muttdebug0
1462 .muttdebug0
magic:~$ grep -c 'mail_addr_is_user:' .muttdebug0
211

after going to Sent folder:
magic:~$ wc -l .muttdebug0
124381 .muttdebug0
magic:~$ grep -c 'mail_addr_is_user:' .muttdebug0
427

I send an Email, it gets added to my Sent folder, and wait 5mn for mutt to
resync:
magic:~$ wc -l .muttdebug0
723660 .muttdebug0
magic:~$ grep -c 'mail_addr_is_user:' .muttdebug0
380841

So, that's almost 10 mail_addr_is_user per mail in the inbox, and each takes
almost 0.0008s, which yields 300 seconds for 40,000 messages.

First, it looks like mail_addr_is_user is a pretty slow call, but it's also 
weird
that it gets called so many times.

Hopefully that helps pinpointing the problem.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/