From 500e967730183f05b3bbf12b2fbffe1d843b21f9 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Fri, 13 Nov 2015 16:29:55 +0000 Subject: [PATCH] timer --- contrib/other-builds/moses2/Jamfile | 1 + contrib/other-builds/moses2/Main.cpp | 5 +++++ .../moses2/TranslationModel/PhraseTableMemory.cpp | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/contrib/other-builds/moses2/Jamfile b/contrib/other-builds/moses2/Jamfile index 5df8ab7d8..887fe5b87 100644 --- a/contrib/other-builds/moses2/Jamfile +++ b/contrib/other-builds/moses2/Jamfile @@ -47,6 +47,7 @@ import path ; legacy/Range.cpp legacy/SquareMatrix.cpp legacy/ThreadPool.cpp + legacy/Timer.cpp legacy/Util2.cpp legacy/ProbingPT/hash.cpp legacy/ProbingPT/huffmanish.cpp diff --git a/contrib/other-builds/moses2/Main.cpp b/contrib/other-builds/moses2/Main.cpp index 55a75d6ba..2abc7d920 100644 --- a/contrib/other-builds/moses2/Main.cpp +++ b/contrib/other-builds/moses2/Main.cpp @@ -6,6 +6,7 @@ #include "legacy/InputFileStream.h" #include "legacy/Parameter.h" #include "legacy/ThreadPool.h" +#include "legacy/Timer.h" using namespace std; @@ -34,6 +35,8 @@ int main(int argc, char** argv) istream &inStream = GetInputStream(params); cerr << "system.numThreads=" << system.numThreads << endl; + Timer timer; + timer.start(); ThreadPool pool(system.numThreads); @@ -51,6 +54,8 @@ int main(int argc, char** argv) delete &inStream; } + + cerr << "Decoding took " << timer.get_elapsed_time() << endl; // cerr << "g_numHypos=" << g_numHypos << endl; cerr << "Finished" << endl; } diff --git a/contrib/other-builds/moses2/TranslationModel/PhraseTableMemory.cpp b/contrib/other-builds/moses2/TranslationModel/PhraseTableMemory.cpp index 2cb332fd2..aa913bc6e 100644 --- a/contrib/other-builds/moses2/TranslationModel/PhraseTableMemory.cpp +++ b/contrib/other-builds/moses2/TranslationModel/PhraseTableMemory.cpp @@ -100,9 +100,13 @@ void PhraseTableMemory::Load(System &system) MemPool tmpPool; vector toks; + size_t lineNum = 0; InputFileStream strme(m_path); string line; while (getline(strme, line)) { + if (++lineNum % 10000) { + cerr << lineNum << " "; + } toks.clear(); TokenizeMultiCharSeparator(toks, line, "|||"); assert(toks.size() >= 3);