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

Re: Mark messages in mailbox as read without massive performance hit?!



On Thu, Dec 29, 2005 at 02:12:57AM -0500, Derek Martin wrote:
> On Thu, Dec 29, 2005 at 01:44:31AM -0500, Derek Martin wrote:
> > On Thu, Dec 29, 2005 at 07:18:55AM +0100, Stanislaw Halik wrote:
> > > Derek Martin <invalid@xxxxxxxxxxxxxx> wrote:
> > > > But 1000 messages isn't 50,000 messages.  Try again with that number
> > > > and see how well you do.  You might be surprised, even on FreeBSD's
> > > > optimized filesystem.
> > > 
> > > 17 seconds. unfortunately, I haven't got any mboxes of that size to
> > > compare results.
> > 
> > If you can do this on your own mail server, so that you won't risk
> > making your system administrator very very angry, you can create such
> > a mailbox with this script:
> 
> Yeah, uh... don't run that script.  Sorry!  You'll bomb your system.

LOL!  And wholly unecessary.

http://en.wikipedia.org/wiki/Mbox#File_format

############################################################
#!/bin/bash
# Generate a dummy mbox to evaluate performance

limit=50000
date=`date`
mbox=$HOME/dummy-mbox
string="\
Lorem ipsum est melius albucius id, stet congue postea quo eu.
Et nec agam mutat, ius ne expetenda imperdiet, in odio eruditi
ius. Eum ea modus corrumpit, erant postea eum no, lorem
complectitur consequuntur quo cu. Cu has oporteat accusata
voluptatibus, dolores sapientem eu vix. Reque noster suavitate
an qui.

"

for (( i=1; i <= $limit; i++ )) ; do
    printf "Generating message $i\n"
    printf "From $date\nDate: $date\nSubject: Message $i of $limit\n\n\
$string$string" >> $mbox;
done

exec mutt -f $mbox
############################################################

real    1m38.336s
user    0m56.746s
sys     0m28.372s