<Summary> Simple C/C++ Perfometer: Reading file to string (Versions 1.x)

620 views
Skip to first unread message

Alex Vinokur

unread,
Apr 21, 2005, 4:25:30 AM4/21/05
to C++ Perfometer Google Group
###############
### Summary ###
###############

=========================================
* Performance
* Comparative Performance Measurement
-----------------------------------------
* Tool : Simple C/C++ Perfometer
* Algorithm: Reading file into string
* Language : C++
* Version : F2S-1.0
-----------------------------------------
* Environment : Windows 2000 Professional
Intel(R) Celeron(R) CPU 1.70 GHz
Cygwin
* Compilers : GNU g++ 3.3.3
* Optimization : No optimization
=========================================



Testsuites:
-----------
Set of testsuites for "Reading contents from file into one string"
contains 29 testsuites:
* 4 - for C language,
* 1 - for UNIX system calls,
* 24 - for C++ language.



Simple C/C++ Perfometer for "Reading file into string":
-------------------------------------------------------
* http://groups-beta.google.com/group/perfo/msg/8273f4d1a05cfbd1
* http://article.gmane.org/gmane.comp.lang.c++.perfometer/110
* http://permalink.gmane.org/gmane.comp.lang.c++.perfometer/110
* http://comments.gmane.org/gmane.comp.lang.c++.perfometer/110
* http://cache.gmane.org/gmane/comp/lang/c++/perfometer/110
-------------------------------------------------------



Summary
-------
Test results sorted by ascending time used
(the best of time used in binary and text openmode).


Cygwin, GNU g++ 3.3.3
File size : 10000
Number of repetitions : 25
CLOCKS_PER_SEC : 1000
===========================================================================
| Testsuite | File OpenMode |
|-------------------------------------------------------|-----------------|
| Code : Name | binary : text |
|-------------------------------------------------------|-----------------|
| C-04 : C-function fread, max size buffer | 10 : 10 |
| C-03 : C-function fread, const size buffer | 10 : 13 |
| CPP-24 : std::string and istream::read | 10 : 16 |
| Unix-C-05 : UNIX system call mmap | 13 : 53 |
| CPP-05 : istream::read, ostream::write, | 20 : 30 |
| : const size buffer | : |
| CPP-06 : istream::read, ostream::write, | 20 : 30 |
| : ostringstream, const size buffer | : |
| CPP-04 : ifstream::rdbuf, ostream::operator<< | 20 : 33 |
| CPP-08 : istream::read, ostream::write | 23 : 30 |
| : max size buffer | : |
| CPP-03 : streambuf::sbumpc, ostream::operator<< | 26 : 30 |
| CPP-23 : std::vector, istream::read | 33 : 43 |
| CPP-07 : istream::readsome, ostream::write | 53 : 60 |
| : const size buffer | : |
| CPP-11 : istream::getline, ostringstream | 56 : 57 |
| : ostream::operator<< | 56 : 57 |
| CPP-14 : istream::get(char*, streamsize), | 56 : 57 |
| : ostream::operator<<, const size | : |
| CPP-15 : istream::get(streambuf&), streambuf, | 163 : 76 |
| : ostream::operator<< | : |
| CPP-20 : istreambuf_iterator, std::string | 193 : 167 |
| CPP-18 : istreambuf_iterator, ostreambuf_iterator, | 187 : 370 |
| : std::copy | : |
| CPP-19 : istreambuf_iterator, ostreambuf_iterator, | 270 : 190 |
| : std::transform | : |
| CPP-13 : istream::get(char) | 1442 : 1428 |
| CPP-22 : std::vector, push_back() | 1502 : 1452 |
| CPP-17 : istream_iterator, std::string | 1542 : 1592 |
| CPP-09 : std::getline, ostringstream, | 1656 : 1619 |
| : ostream::operator<< | 1656 : 1619 |
| CPP-02 : streambuf::sbumpc | 1625 : 1652 |
| CPP-10 : std::getline, std::string, | 1665 : 1652 |
| : ostream::operator<< | : |
| C-02 : C-function fgetc | 1939 : 1966 |
| C-01 : C-function getc | 2002 : 1983 |
| CPP-21 : std::vector, std::copy | 2827 : 2890 |
| CPP-12 : istream::get(char), ostream::put | 2830 : 2841 |
| CPP-01 : istream::operator>> | 2951 : 2957 |
| CPP-16 : istream_iterator, ostream_iterator, | 4232 : 4269 |
| : std::copy | : |
===========================================================================


--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn




Reply all
Reply to author
Forward
0 new messages