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!
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 might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
I think what the OP means is that the original file format is fixed, and can't (easily) be changed.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
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)]++; }