This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11722] Unbuffered filebuf::sgetn 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 Jul 2003 09:10:36 -0000
- Subject: [Bug libstdc++/11722] Unbuffered filebuf::sgetn is slow
- References: <20030730090653.11722.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=11722
------- Additional Comments From peturr02 at ru dot is 2003-07-30 09:10 -------
Created an attachment (id=4520)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4520&action=view)
Program for comparing unbuffered input performance.
Here are typical results:
time ./inspeed stdio 1000000 10
0.75user 1.36system 0:02.19elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (92major+12minor)pagefaults 0swaps
time ./inspeed iostream 1000000 10
7.93user 12.44system 0:21.04elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (94major+12minor)pagefaults 0swaps
This shows that when reading 10 characters at a time, filebuf::sgetn is 10x
slower than fread_unlocked.