I have a 2 GB file (iputfile.txt
) in which every line in the file is a word, just like:
apple
red
beautiful
smell
spark
input
I am not expert in C++, but you have at least the following to affect performance:
Since I/O cost is the major cost here, I guess 1 and 2 are the major reasons.