From cfef250df7ef378d6678bb6fc26402407f496184 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Fri, 22 Feb 2013 16:50:29 +0000 Subject: Memory analysis pointless code. --- extractor/rule_factory.cc | 2 ++ extractor/run_extractor.cc | 8 ++++++++ extractor/vocabulary.cc | 5 +++++ extractor/vocabulary.h | 2 ++ 4 files changed, 17 insertions(+) (limited to 'extractor') diff --git a/extractor/rule_factory.cc b/extractor/rule_factory.cc index 4101fcfa..fbdc7cce 100644 --- a/extractor/rule_factory.cc +++ b/extractor/rule_factory.cc @@ -220,6 +220,8 @@ Grammar HieroCachingRuleFactory::GetGrammar(const vector& word_ids) { } } + cerr << "Vocabulary size = " << vocabulary->Size() << endl; + Clock::time_point stop_time = Clock::now(); cerr << "Total time for rule lookup, extraction, and scoring = " << GetDuration(start_time, stop_time) << " seconds" << endl; diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index 38f10a5f..2b01e832 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -31,6 +31,14 @@ namespace fs = boost::filesystem; namespace po = boost::program_options; using namespace std; +void my_pause() { + cerr << "pausing..." << endl; + for (int i = 0; i < 10000000; ++i) { + cerr << endl; + } + cerr << "end pause" << endl; +} + int main(int argc, char** argv) { // TODO(pauldb): Also take arguments from config file. po::options_description desc("Command line options"); diff --git a/extractor/vocabulary.cc b/extractor/vocabulary.cc index 5c379a29..b68d76a9 100644 --- a/extractor/vocabulary.cc +++ b/extractor/vocabulary.cc @@ -24,3 +24,8 @@ bool Vocabulary::IsTerminal(int symbol) { string Vocabulary::GetTerminalValue(int symbol) { return words[symbol]; } + +int Vocabulary::Size() { + return words.size(); +} + diff --git a/extractor/vocabulary.h b/extractor/vocabulary.h index c6a8b3e8..ff3e7a63 100644 --- a/extractor/vocabulary.h +++ b/extractor/vocabulary.h @@ -19,6 +19,8 @@ class Vocabulary { virtual string GetTerminalValue(int symbol); + int Size(); + private: unordered_map dictionary; vector words; -- cgit v1.2.3