[Bug libstdc++/11722] Unbuffered filebuf::sgetn is slow

peturr02 at ru dot is gcc-bugzilla@gcc.gnu.org
Wed Jul 30 09:10: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=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.



More information about the Gcc-bugs mailing list