nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] discard() declared eeevil

2011-12-26 21:38:21
On Monday, December 26, 2011,  <Valdis(_dot_)Kletnieks(_at_)vt(_dot_)edu> wrote:
On Mon, 26 Dec 2011 20:29:37 EST, Jeffrey Honig said:

If I remember right, m_getfld.c tries to eek the most performance out of
header field scanning by taking advantage of knowledge of the stdio
structures to peek further into the buffer and do an optimized ungetc().

Wow, is *that* what it was doing?  I got confused because I didn't see a
#else
clause that had ungetc() in it.  Even the fallback cases were somewhere
between
abstruse and baroque.

That was necessary in the days when a VAX was fast.  But these days my
cell
phone is faster than a room full of VAXen and we could re-write the code
to
be more readable and no-one would know the difference.

With 2 decades of improvement in gcc and glibc, it's quite possible that
just
coding ungetc() and letting the computer figure out the best way to do it
would actually result in faster code than what nmh is doing. ;)

You have to remember that pcc was state if the art when that code was
written.



-- 
Thanks

Jeff

-- 
Jeffrey C. Honig <jch(_at_)honig(_dot_)net>
http://www.honig.net/jch
GnuPG ID:14E29E13 <http://www.honig.net/jch/key.shtml>
_______________________________________________
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>