================================================== --- Reading contents from file into one string --- Comparative performance measurement =================================================== Testsuite : Reading contents from file into one string Source : Testsuites of C/C++ Program Perfometer Tool : The C/C++ Program Perfometer (Version 2.9.0-1.19.2) * http://sourceforge.net/projects/cpp-perfometer/ (Version 2.9.0-1.19) Environment : Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 4 Intel(R) Celeron(R) CPU 1.70 GHz CYGWIN_NT-5.0 1.5.12(0.116/4/2) i686 Cygwin GNU g++ version 3.3.3 (cygwin special) Compilation : g++ *.cpp DLLs : The names of DLL files on which the C++ Perfometer program depends c:\cygwin\bin\cygwin1.dll C:\WINNT\system32\ADVAPI32.DLL C:\WINNT\system32\NTDLL.DLL C:\WINNT\system32\KERNEL32.DLL C:\WINNT\system32\RPCRT4.DLL #===================================================================== # ---------- Synchronized I/O ---------- # Reading contents from file into one string # ---- Summary --- # ---------------- # ---------------------------------------- # The testsuite is from C/C++ Program Perfometer # File t_file.cpp #--------------------------------------------------------------------- # Resource Name : CPU-time used # Resource Cost Unit : clock # Resource State Unit : clock #===================================================================== # Total repetitions : 10 # Performance metrics : clock / 10 repetitions #===================================================================== Measurement has been performed for the following optimization levels: * No optimization Total 10 repetitions Performance = milliseconds per 10 repetitions Here are summary results of the measurement. -------------------------------------------- ============================================ No Optimization -------------------------------------------- Full raw run log: http://groups-beta.google.com/group/log-files/msg/1f7160243fd793cb http://groups-beta.google.com/group/log-files/attach/1f7160243fd793cb/perfo_log_file2str.txt?part=2 ======================================================== | | File size | | Testsuite |------------------------| | | 1000 : 10000 : 100000 | |------------------------------------------------------| | getline | 125 : 839 : 7729 | | vector, reading char | 75 : 592 : 5816 | | string, reading char | 71 : 570 : 5626 | | vector, reading whole file | 16 : 30 : 146 | | mmap (UNIX) | 13 : 18 : 30 | | istream_iterator | 80 : 597 : 6028 | | ostringstream, rdbuf | 15 : 20 : 66 | | istreambuf_iterator | 30 : 71 : 624 | ========================================================