Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2007 09:52:21 -0800
From:      "Randall Hyde" <randyhyde@earthlink.net>
To:        <freebsd-hackers@freebsd.org>
Subject:   Re: Some FreeBSD performance Issues
Message-ID:  <002701c8248b$9c2b8110$6302a8c0@pentiv>
References:  <000701c82253$b3a8c030$6302a8c0@pentiv> <20071108225238.GB22005@dan.emsphone.com> <4734061D.9000606@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002701c8248b$9c2b8110$6302a8c0>