Index: engines/agi/predictive.cpp =================================================================== --- engines/agi/predictive.cpp (revision 27374) +++ engines/agi/predictive.cpp (working copy) @@ -506,19 +506,27 @@ #define MAXLINELEN 80 void AgiEngine::loadDict(void) { - Common::File in; + Common::File inFile; char buf[MAXLINELEN]; int words = 0, lines = 0; ConfMan.registerDefault("predictive_dictionary", "pred.dic"); + + uint32 time1 = _system->getMillis(); - if (!in.open(ConfMan.get("predictive_dictionary"))) + if (!inFile.open(ConfMan.get("predictive_dictionary"))) return; + + Common::MemoryReadStream *in = inFile.readStream(inFile.size()); + inFile.close(); + + uint32 time2 = _system->getMillis(); + printf("Time to read pred.dic: %d\n", time2-time1); _searchTreeRoot = new SearchTree(); words = 0; - while (!in.eos() && in.readLine(buf, MAXLINELEN)) { + while (!in->eos() && in->readLine(buf, MAXLINELEN)) { // Skip leading & trailing whitespaces char *word = Common::trim(buf); @@ -540,6 +548,11 @@ } } } + + delete in; + + uint32 time3 = _system->getMillis(); + printf("Time to parse pred.dic: %d, total: %d\n", time3-time2, time3-time1); debug(0, "Loaded %d lines with %d words", lines, words); }