Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2007 16:52:38 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Randall Hyde <randyhyde@earthlink.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Some FreeBSD performance Issues
Message-ID:  <20071108225238.GB22005@dan.emsphone.com>
In-Reply-To: <000701c82253$b3a8c030$6302a8c0@pentiv>
References:  <000701c82253$b3a8c030$6302a8c0@pentiv>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Nov 08), Randall Hyde said:
> It appears that character-at-a-time file I/O is *exceptionally* slow.
> Yes, I realize that when processing large files I really ought to be
> doing block/buffered I/O to get the best performance, but for certain
> library routines I've written it's been far more convenient to do
> character-at-a-time I/O rather than deal with all the buffering
> issues.  In the past, while slower, this character-at-a-time paradigm
> has provided reasonable, though not stellar, performance under
> Windows and Linux. However, with the port to FreeBSD I'm seeing a
> three-orders-of-magnitude performance loss.  Here's my little test
> program:
[...] 
> The "fileio.open" call is basically a bsd.open( "socket.h", bsd.O_RDONLY );
> API call.  The socket.h file is about 19K long (it's from the FreeBSD
> include file set). In particular, I would draw your attention to the first
> two tests that do character-at-a-time I/O. The difference in performance

What timings does 
"dd if=/usr/include/sys/socket.h of=/dev/null ibs=1 obs=64k" report? 
It takes about .4 sec on my non-idle dual pIII-900 system.  Try
truss'ing your program as it runs; maybe the program is doing some
extra syscalls you aren't aware of?

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071108225238.GB22005>