Originally Posted by
conte0
hello,
first, if you want make fast i/o with fstream class, is better if you remove the synchronization between stdio and fstream. just call "std::ios_base::sync_with_stdio(false);" before use fstream class.
second if you want sort huge file (file that don't fit in memory) try to read same chunks in memory and use quick sort on they, after use merge sort on the chucks to create an huge sorted file.
third use a std::string like key value in std::map is slow, usually if you can, try to use a type with a fast "< operator" for the key value.