[Bug libstdc++/11378] Unbuffered sputn is slow
peturr02 at ru dot is
gcc-bugzilla@gcc.gnu.org
Mon Jun 30 10:53:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11378
------- Additional Comments From peturr02 at ru dot is 2003-06-30 10:53 -------
Created an attachment (id=4308)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4308&action=view)
Tool for comparin unbuffered IO performance
Here are some results for my machine (Pentium III Xeon 500MHz, 512MB RAM):
time ./speed stdio 100000 10
0.12user 1.09system 0:01.21elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (82major+12minor)pagefaults 0swaps
time ./speed iostream 100000 10
0.94user 9.80system 0:10.76elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (84major+12minor)pagefaults 0swaps
It seems that fwrite is O(N) but basic_filebuf::sputn is O(M * N) where N is
the number of iterations and M the number of bytes written per iteration.
More information about the Gcc-bugs
mailing list