nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] MH-W intro/help request

2014-12-04 06:22:31
Hi Erich,

Is there any way I can completely avoid the giant folder check?  I
can't think of why it is being done time after time for simple program
invokations that, for example, refer to a specifically enumerated
message.

I do not have `unseen-sequence' set in .mh_profile, so it does not need
updating.

    $ strace -e open,getdents show 42 >/dev/null
    open("/etc/ld.so.cache", O_RDONLY)      = 3
    ...Shared libraries...
    open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 4
    open("/home/ralph/mail/.lk00467ebtnu", O_WRONLY|O_CREAT|O_EXCL, 0644) = 4
    open("/home/ralph/mail/foo", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
    getdents(3, /* 1141 entries */, 32768)  = 32768
    ...19 similar snipped...
    getdents(3, /* 628 entries */, 32768)   = 17944
    getdents(3, /* 0 entries */, 32768)     = 0
    open("/home/ralph/mail/foo/.mh_sequences", O_RDONLY) = 3
    open("/home/ralph/mail/foo/.lk00467ebtnu", O_WRONLY|O_CREAT|O_EXCL, 0644) = 
4
    open("/home/ralph/mail/foo/.mh_sequences", O_WRONLY|O_CREAT|O_TRUNC, 0666) 
= 3
    open("/home/ralph/mail/foo/.lk00467ebtnu", O_WRONLY|O_CREAT|O_EXCL, 0644) = 
4
    open("/home/ralph/mail/mhl.format", O_RDONLY) = 3
    open("42", O_RDONLY)                    = 3
    open("/etc/localtime", O_RDONLY)        = 4
    $

Since .mh_sequences is first read and then written to, it looks like the
"make it match reality" code runs every time.  I agree, when `42' is
explicitly given, and there's no unseen sequence that might need
updating, .mh_sequences could be skipped entirely.  When `42' is
omitted, then .mh_sequences needs reading to get `cur', but it need not
be written, leaving detritus in sequences to be cleaned up by a later
command that cares.  In both cases, the getdents() aren't needed.

BTW, getdents() is also impacted by ,314 and friends that clutter a mail
folder.  On a busy, unpacked, +inbox, they can grow many.

Cheers, Ralph.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>