This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11378] Unbuffered sputn is slow
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2003 10:53:30 -0000
- Subject: [Bug libstdc++/11378] Unbuffered sputn is slow
- References: <20030630104829.11378.peturr02@ru.is>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.