Hi,
MSVC 9
Boost 1.38
I have an existing program that reads text files a line at a time using the std::ifstream and istream& getline ( istream& is, string& str );
Typical file size is ~40mb
To increase the file reading performance i used boost::iostream s::mapped_file_ source and tokenized the memory buffer using boost::algorith m::split with "\n" as delimiter
Before implementing this change in the main program i wrote this logic in a small test program and i found that using the boost memory mapped file is almost 50% faster than using std::fstream
However when i implemented the same logic in my main program i did not get the same performance improvement. [Note: I have taken care to ensure that no other logic in my main program is negating any performance gain achieved by using the memory mapped files]
/O2 and /GL are enabled
Size of small test program: 180K
Size of main program: 680K
I am using the /MT option to link to the boost libs
Can someone thow some light onto this behaviour please.
Thanks
Regards,
Ameya
MSVC 9
Boost 1.38
I have an existing program that reads text files a line at a time using the std::ifstream and istream& getline ( istream& is, string& str );
Typical file size is ~40mb
To increase the file reading performance i used boost::iostream s::mapped_file_ source and tokenized the memory buffer using boost::algorith m::split with "\n" as delimiter
Before implementing this change in the main program i wrote this logic in a small test program and i found that using the boost memory mapped file is almost 50% faster than using std::fstream
However when i implemented the same logic in my main program i did not get the same performance improvement. [Note: I have taken care to ensure that no other logic in my main program is negating any performance gain achieved by using the memory mapped files]
/O2 and /GL are enabled
Size of small test program: 180K
Size of main program: 680K
I am using the /MT option to link to the boost libs
Can someone thow some light onto this behaviour please.
Thanks
Regards,
Ameya
Comment