LZ index support
authornvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 29 May 2009 14:39:23 +0000 (14:39 +0000)
committernvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 29 May 2009 14:39:23 +0000 (14:39 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@421 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

testTextCollection.cpp

index 166c019..82bf79e 100644 (file)
@@ -40,14 +40,14 @@ int main()
   int i = 0 ,j = 0;
   int heap_base = HeapProfiler::GetHeapConsumption();
   std::cerr << "Initial heap usage : " << heap_base << "\n";
-  TextCollectionBuilder *tcb = new TextCollectionBuilder(32);
+  TextCollectionBuilder *tcb = new TextCollectionBuilder(5);
   heap_base = HeapProfiler::GetHeapConsumption ();
   std::cerr << "Heap usage after InitTextCollection : " << heap_base << "\n";
   Tools::StartTimer();
 
   while (not(cin.eof())){
-      getline(cin,str); // Read line by line.
-//    cin >> str; // Read word by word.
+   getline(cin,str); // Read line by line.
+//   cin >> str; // Read word by word.
     data = (uchar *) str.c_str();
     if (str.size() == 0)
         continue;
@@ -86,14 +86,14 @@ int main()
       std::cout << "over bounds" << std::endl;
   delete [] temp;*/
   
-  HeapProfiler::ResetMaxHeapConsumption();
 
   std::cerr << "Creating new text collection with " << i << " strings (total " << j/1024 << " kb)\n"; 
+  std::cerr << "max heap usage: " << HeapProfiler::GetMaxHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;
+  HeapProfiler::ResetMaxHeapConsumption();
   std::cerr << "Before MakeStatic() [press enter]\n";
   //std::cin >> kbd;
   // This will print the maximum mem usage during construction time:
-  std::cerr << "max heap usage: " << HeapProfiler::GetMaxHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;
-  TextCollection* tc = tcb->InitTextCollection();
+  TextCollection* tc = tcb->InitTextCollection();//SXSI::TextStorage::TYPE_LZ_INDEX);
   delete tcb; tcb = 0;
   std::cerr << "After MakeStatic() [press enter]\n";
   // This will print the maximum mem usage during MakeStatic():