// pt_test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include "parse_usenet.h" int _tmain(int argc, _TCHAR* argv[]) { using boost::property_tree::ptree; ptree groupTree; boost::timer tmr; std::string tmp; tmr.restart(); ReadGroupsList(std::string("NewsGroups.txt"), groupTree); std::cout << "Loaded " << static_cast(groupTree.size()) << " records from disk in " << tmr.elapsed() << " seconds\n"; tmr.restart(); for (int i = 1; i < 1000; i++) { tmp = groupTree.get_own("zipnews.gov.us.federal.reserve.fdic"); } std::cout << "Found zipnews.gov.us.federal.reserve.fdic in " << tmr.elapsed() / 1000 << " seconds (agv from 1K searches)\n"; tmr.restart(); for (int i = 1; i < 1000; i++) { groupTree.put("zipnews.gov.us.federal.reserve.fdic", "changed"); } std::cout << "Updated zipnews.gov.us.federal.reserve.fdic in " << tmr.elapsed() / 1000 << " seconds (agv from 1K searches)\n"; tmr.restart(); WriteGroupsList(std::string("SavedNewsGroups.txt"), groupTree); std::cout << "Saved " << static_cast(groupTree.size()) << " records to disk in " << tmr.elapsed() << " seconds\n"; return 0; }