I canīt cheat changing the file format hehe. Actually im pretty satisfied with my parser speed now, thank you all, your tips were very usefull!
Printable View
I canīt cheat changing the file format hehe. Actually im pretty satisfied with my parser speed now, thank you all, your tips were very usefull!
What do you mean by cheating?
It is always nice to have an easily readable file.
I think what the OP means is that the original file format is fixed, and can't (easily) be changed.
--
Mats
matsp is right.
Ok, im a tireless optimizer, i have improved t3 performance mark with the following parsing:
I was able to squeeze out 1,266 seconds from this function, over the 1.5s of before...Code:for (string::size_type i = 0;;)
{
while (line[++i] == '-' && i < end); //find first '-' character
if (i >= end) { break; }
begin = i;
while (line[++i] != '-' && i < end); //find first not of '-' character
dictionary[line.substr(begin, i - begin)]++;
}