Some FreeBSD performance Issues
Randall Hyde
randyhyde at earthlink.net
Sun Nov 11 09:52:32 PST 2007
Hi All,
Well, I've done some sleuthing and discovered some issues.
First, the "dd" command produced approximately the same results everyone
else was getting. So I rewrote a version of my test code in C using the
stdlib "read" call and it had really great performance. Not understanding
why C's code was so much faster, I dug into the source code and discovered
that open/read/write/etc. use *buffered* I/O (which explains why "dd"
performs so well).
At this point I'm not sure why FreeBSD's API call is so slow (btw, it's not
the system call that's responsible, if I make several additional API calls
on each read, e.g., doing lseeks, this has only a marginal impact on
performance). But it's pretty clear that if I expect reasonable performance
in my own library I'm going to have to do the same thing that glib does and
switch over to buffered I/O. Pain in the butt, but there's nothing else to
do at this point.
Cheers,
Randy Hyde
More information about the freebsd-hackers
mailing list