This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Report for __FreeBSD__


On Fri, Aug 08, 2003 at 03:43:18PM +0200, Paolo Carlini wrote:
> This is for my P4-2400 (by the way, quite proud of the sputc and copy 
> tests: the gap with stdio (unlocked!) is really thin by now :)

> filebuf_copy.cc      	C unlocked	 934r  878u   47s    0mem    5pf 
> filebuf_copy.cc      	C++       	1159r 1101u   41s    0mem    1pf 
> filebuf_sputc.cc     	C         	 753r  667u   52s    0mem    4pf 
> filebuf_sputc.cc     	C unlocked	 319r  261u   49s    0mem    0pf 
> filebuf_sputc.cc     	C++       	 347r  280u   48s    0mem    0pf 

Interestingly, the results get very different when you compile
with "-funroll-all-loops".  For some reason the stdio loops get
unrolled, while the streambuf loops don't.

Also interestingly, on my P2, the streambuf tests actually come out 
ahead of stdio (when the latter's loops aren't unrolled).

>From what I've been able to discern, the reason that the C++ loops still 
come out slightly slower here (on P>2) is that stdio can put one of its 
__iobuf pointers at offset zero in the struct, where iostream has no 
choice but to put its vptr there.  That's an unfortunate consequence of 
the new ABI.  

Earlier versions of the compiler were able to unroll the streambuf
loops in the filebuf_copy test program.  I wonder what changed.

Nathan Myers
ncm-nospam@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]