nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] m_getfld

2012-12-10 22:47:39
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

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