libstdc++/9876: filebuf::sputc more than 10% slower than putc

Pétur Runólfsson peturr02@ru.is
Fri Feb 28 15:57:00 GMT 2003


>     Yes, filebuf::sputc shall be improved: patches welcome,
>     or, otherwise, stay tuned!
>     
>     However, the funny thing of your PR is that, as a matter of
>     fact, I *cannot* reproduce the trend neither with mainline
>     (which produces better code, indeed) nor with 3.2.2!

Whoops, s/putc/putc_unlocked/ :-P

putc calls flockfile/funlockfile for each character,
streambuf::sputc does not do so and should be compared against
putc_unlocked.

Petur



More information about the Gcc-bugs mailing list