nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] m_getfld

2012-12-10 22:54:44
Paul Vixie writes:
On 2012-12-11 4:32 AM, Ken Hornstein wrote:

Also ... maybe I'm just showing my age, but I always felt that mmap()
should be reserved for special-purpose uses, and this ain't one of them
(IMHO).

there's no way to avoid string copy overhead if you use read(), unless
you're on a rare kernel that will see a page aligned page sized buffer
passed to it and do page flipping from the buffer cache. i love the fact
that freebsd "cp" uses mmap when it can. looks like "ar", "cmp", and
"tail" also do this. fun!

but m_getfld isn't reading mail bodies, just headers. they fit in one
page on almost all modern machines and all mail messages. i'd say
there's no advantage to mmap if it's only saving us a 4K string copy
from kernel to user mode. stdio doesn't prefetch all that much.

paul

First of all, I'm pleased that at least folks are talking about getting
rid of m_getfld.  I like Paul's idea of just writing something new and
migrating over to it.

I would like to see a separation between parsing mail messages and reading
profiles and such.  Seems like the old code is really doing two completely
unrelated things, maybe to save a few bytes in the old days.

I don't quite agree with Paul on the "just headers" part of things.  I would
like any m_getfld replacement to have the ability to extract information
about MIME message parts which means finding headers in the middle of bodies.
As per postings some years ago, I would like to add code for reading attachments
that needs this feature.  Unfortunately I don't have time to do much more than
lurk at the moment.

Jon

_______________________________________________
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>