This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/5742] stdio poor file buffering in "w+b" mode


------- Additional Comments From wucknitz at astro dot uni-bonn dot de  2010-04-16 07:54 -------
This problem still seems to be around. I wasn't aware of it until I tried a
program that fseeks/freads its way through a big file on a RAID system with
large st_blksize. While it is fast on a normal disk with st_blksize=4096, it is
incredibly slow on the RAID with ~5.5MB, even though the RAID is otherwise very
fast. In this particular case I have access to the source code and could set the
io to unbuffered (with setvbuf). That brought the execution time down from
>80min to 14sec, i.e. a factor of 350 in a real life case. There are probably
other applications around in which the behaviour that fseek does a read ahead
can cause huge performance problems. It would be really nice if it could be fixed.

As a test I tried to skip through blocks of a large file with many fseeks
without actually reading anything. Trying that on different disks and
filesystems, I saw a very clear correlation between st_blksize and execution
time. Particularly on high performance RAID systems you do not really want to
spend most of the time copying huge amounts of data from one buffer to the other.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5742

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]