in reply to Re: EEK! sysread() is expensive!
in thread Last N lines from file (tail)

Well, sure, because a plain read() would have used stdio, which probably translated to the equivalant of sysread(4096) at least. If you're doing N reads of one byte, then change that to N reads of 4096 bytes, of course you'll have a slowdown ... and a wasteful one, since every time you read a block you use only one byte.

    -- Chip Salzenberg, Free-Floating Agent of Chaos