How long does an empty loop take?
while (getline(inFile, s)) {
}
Separate the "time to read the file" from the time to "tokenise the file".
It it takes <1 second, then there might be something you can do.
If it takes >3 seconds, then all your tokenising/vector stuff is not the problem.
> and i desperately need to minimize the running time as i need to iterate thru
> thousands of such files
Or just not worry about it and let the program run overnight, and it will all be done by morning anyway. If that can be done, it certainly isn't worth spending more than a day trying to make it vastly more efficient.
By your measure, it's about 900 files per hour.