the run times has 2 times difference( formatted one FASTER than unformatted ). [ compile option -O3 ]
void test_stream_inserter() { int a = 1111; std::stringstream is; for( unsigned int i=0; i<1024*1024*100; ++i ) { void* pa = ((void*)&a); void** pb = &pa; #ifdef FORMATTED is << pb; is >> pa; #else is.write( (const char*)pb, sizeof(pb) ); is.read( (char*)pb, sizeof(pb) ); #endif } } -- Summary: stream unformatted inserter is slower than formatted inserter Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: liugavin at hotmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44510