Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Nov 2007 18:35:20 +0800
From:      Dinesh Nair <dinesh@alphaque.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        freebsd-hackers@freebsd.org, Randall Hyde <randyhyde@earthlink.net>
Subject:   Re: Some FreeBSD performance Issues
Message-ID:  <20071109183520.07a6b35a@prophet.alphaque.com>
In-Reply-To: <20071108225238.GB22005@dan.emsphone.com>
References:  <000701c82253$b3a8c030$6302a8c0@pentiv> <20071108225238.GB22005@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 8 Nov 2007 16:52:38 -0600, Dan Nelson wrote:

> 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?
> 

on FreeBSD 6.2-RELEASE, it returns,

dd if=/usr/include/sys/socket.h of=/dev/null ibs=1 obs=64k
18426+0 records in
0+1 records out
18426 bytes transferred in 0.070472 secs (261466 bytes/sec)

-- 
Regards,                           /\_/\   "All dogs go to heaven."
dinesh@alphaque.com                (0 0)   http://www.openmalaysiablog.com/
+==========================----oOO--(_)--OOo----==========================+
| for a in past present future; do                                        |
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo "The opinions here in no way reflect the opinions of my $a $b."  |
| done; done                                                              |
+=========================================================================+



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