performance, boost mmap files, fstream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ameyav
    New Member
    • Mar 2009
    • 8

    performance, boost mmap files, fstream

    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
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Not really except to say you rarely get best case potential improvement in a real life program.

    Comment

    Working...